tettusud / merge-jsons-webpack-plugin

This plugin is used to merge json files into single json file,using glob or file names
https://npmjs.com/package/merge-jsons-webpack-plugin
Apache License 2.0
36 stars 20 forks source link

Incompatibility with Webpack 5 #64

Open GorvGoyl opened 3 years ago

GorvGoyl commented 3 years ago

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:

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

aarthishuba commented 3 years ago

@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

HoneyBadgerSeeker commented 3 years ago

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 :)

ybentz commented 2 years ago

Hey! Any updates on this? I found a couple of related issues on html-webpack-plugin that were fixed already in case that helps.