When the node version is greater than 12.4.0, the plug-in cannot work properly, and the node version needs to be limited to 12.4.0 or less, which conflicts with the established node version of many projects.
If the project using this plug-in needs to upgrade the node version for some reason in the future, it will be big trouble.
Overview of the change
Remove node version restrictions in package.json and .nvmrc
Remove unnecessary third-part library deasync
Change the execution method of postcss.process from asynchronous to synchronous
Reason for the code change
When the node version is greater than 12.4.0 and the code executes to postcss.process, this promise neither will be resolved nor be rejected, so the whole process is stuck in loopWhile.
But if we change the execution method of postcss.process from asynchronous to synchronous, it works well with all node version.
Reason for this change
When the node version is greater than 12.4.0, the plug-in cannot work properly, and the node version needs to be limited to 12.4.0 or less, which conflicts with the established node version of many projects.
If the project using this plug-in needs to upgrade the node version for some reason in the future, it will be big trouble.
Overview of the change
deasync
postcss.process
from asynchronous to synchronousReason for the code change
When the node version is greater than 12.4.0 and the code executes to
postcss.process
, this promise neither will be resolved nor be rejected, so the whole process is stuck inloopWhile
. But if we change the execution method ofpostcss.process
from asynchronous to synchronous, it works well with all node version.Tests