node.js and webpack throws error when trying to setup node to watch theme folder for saved changes

It seems to be a syntax error.

The options should be passed inside postcssOption according to the webpack documentation.

Try replacing this line:

  use: ["css-loader?url=false", { loader: "postcss-loader", options: { plugins: postCSSPlugins } }]

With this:

  use: ["css-loader?url=false", { loader: "postcss-loader", options: { postcssOptions : { plugins: postCSSPlugins} } }]