I tried updating my project to the latest vue and webpack but whenever I try to run my app with npm run dev it gives me an error:
[webpack-cli] Failed to load 'E:\repos\project\build\webpack.config.js' config
[webpack-cli] TypeError: webpack.NamedModulesPlugin is not a constructor
I'm using the latest webpack, and webpack-cli:
"webpack": "^5.35.0",
"webpack-cli": "^4.6.0",
"webpack-dev-server": "^3.11.2",
And also my scripts are updated from webpack-dev-serve to webpack serve as shows:
"dev:eih": "npm run generate-assets:test:eih && cross-env TARGET_BRAND=eih cross-env NODE_ENV=development cross-env PROJECT_VERBOSE_LOG=true cross-env PROJECT_MPIN_IN_BROWSER=true webpack serve --config ./build/webpack.config.js",
I could not fin any answer which helped
config.plugins
plugins: [
- new webpack.NamedModulesPlugin(),
]
config.optimization
+ optimization: {
moduleIds: 'named'
}
It looks like it isn't needed anymore has optimizations are already done out of the box.
Although someone suggested replacing it with
optimization: {
moduleIds: 'named'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With