У учебнике в настройке webpack написано
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
Но в результате выполнения npm start я получаю следующее:
> redux@1.0.0 start /Users/alexandermarginal/WebstormProjects/redux
> node server.js
/Users/alexandermarginal/WebstormProjects/redux/webpack.config.js:19
new webpack.NoErrorsPlugin()
^
TypeError: webpack.NoErrorsPlugin is not a constructor
at Object. (/Users/alexandermarginal/WebstormProjects/redux/webpack.config.js:19:3)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/Users/alexandermarginal/WebstormProjects/redux/server.js:7:14)
at Module._compile (module.js:652:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! redux@1.0.0 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the redux@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alexandermarginal/.npm/_logs/2018-06-02T13_03_07_929Z-debug.log
Если я комментирую эти плагины, то ошибка выглядит вот таким образом:
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.module has an unknown property 'loaders'. These properties are valid:
object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, defaultRules?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp?, strictExportPresence?, strictThisContextOnImports? }
-> Options affecting the normal modules (`NormalModuleFactory`).
at webpack (/Users/alexandermarginal/WebstormProjects/redux/node_modules/webpack/lib/webpack.js:24:9)
at Object. (/Users/alexandermarginal/WebstormProjects/redux/server.js:12:16)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! redux@1.0.0 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the redux@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alexandermarginal/.npm/_logs/2018-06-02T13_04_28_830Z-debug.log
Process finished with exit code 1
Все ошибки ведут на строку подключения webpack config и на файл саомго webpack js