Encountered another error:
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
_ - configuration.output.path: The provided value “dist” is not an absolute path!_
To fix change the output path to:
path: __dirname + ‘dist’
Then move the webpack.config.js file to the root folder.
Finally, update the path in package.json
"build": “webpack --config webpack.config.js”