merge-jsons-webpack-plugin
merge-jsons-webpack-plugin copied to clipboard
Incompatibility with Webpack 5
I'm not able to run webpack in development
mode when source-map
is enabled and set to cheap-module-source-map
or inline-source-map
.
On digging I found out your plugin is not fully compatible with webpack v5 which is causing that issue.
To test:
node --trace-deprecation node_modules/webpack/bin/webpack.js
Output:
(node:14444) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.
at MergeJsonWebpackPlugin.addAssets (C:\Users\1gour\OneDrive\Documents\old\Github\Notion-Boost-browser-extension\node_modules\merge-jsons-webpack-plugin\index.js:234:42)
at C:\Users\1gour\OneDrive\Documents\old\Github\Notion-Boost-browser-extension\node_modules\merge-jsons-webpack-plugin\index.js:38:30
at tryCatch (C:\Users\1gour\OneDrive\Documents\old\Github\Notion-Boost-browser-extension\node_modules\es6-promise\dist\lib\es6-promise\-internal.js:195:12)
at invokeCallback (C:\Users\1gour\OneDrive\Documents\old\Github\Notion-Boost-browser-extension\node_modules\es6-promise\dist\lib\es6-promise\-internal.js:210:13)
at publish (C:\Users\1gour\OneDrive\Documents\old\Github\Notion-Boost-browser-extension\node_modules\es6-promise\dist\lib\es6-promise\-internal.js:178:7)
at flush (C:\Users\1gour\OneDrive\Documents\old\Github\Notion-Boost-browser-extension\node_modules\es6-promise\dist\lib\es6-promise\asap.js:98:5)
at processTicksAndRejections (internal/process/task_queues.js:76:11)
You can see that webpack config file: https://github.com/GorvGoyl/Notion-Boost-browser-extension/blob/72c0da7202b2cbcd6006d553fe59035abdb8d9e4/webpack.config.js#L217
steps to reproduce:
- Clone
https://github.com/GorvGoyl/Notion-Boost-browser-extension/tree/webpack5_devtool_bug
-
npm install
- run webpack in development mode
npm run start:ch
- build would fail with above error.
Other relevant information: webpack version: 5.6.0 Node.js version: 12.15.0 Operating System: Win10 Additional tools: Powershell Core, VSCode
I previously filed this bug for Webpack https://github.com/webpack/webpack/issues/12041
@GorvGoyl published new version 2.0.0-alpha, however it has some breaking changes in case of array behaviour, you can check read me file
Even with the new version 2.0.0-alpha, I still get the warning on my project. It's not a big deal so far :)