Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

stats-webpack-plugin produces deprecation warning with webpack v5 #38

Open
lucaswerkmeister opened this issue Oct 28, 2020 · 1 comment

Comments

@lucaswerkmeister
Copy link

To reproduce in a minimal project:

git clone https://github.com/lucaswerkmeister/repro-stats-webpack-plugin-webpack5.git
cd repro-stats-webpack-plugin-webpack5
npm install
npm run build

The result looks like this:


> repro-stats-webpack-plugin-webpack5@1.0.0 build /tmp/repro-stats-webpack-plugin-webpack5                                                        
> node --trace-deprecation node_modules/.bin/webpack                                                                                              

(node:54335) [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 /tmp/repro-stats-webpack-plugin-webpack5/node_modules/stats-webpack-plugin/index.js:21:32
    at Hook.eval [as callAsync] (eval at create (/tmp/repro-stats-webpack-plugin-webpack5/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:7:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/tmp/repro-stats-webpack-plugin-webpack5/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.emitAssets (/tmp/repro-stats-webpack-plugin-webpack5/node_modules/webpack/lib/Compiler.js:763:19)
    at /tmp/repro-stats-webpack-plugin-webpack5/node_modules/webpack/lib/Compiler.js:412:10
    at processTicksAndRejections (node:internal/process/task_queues:75:11)
[webpack-cli] Compilation finished
asset stats.json 3.59 KiB [compared for emit]
asset main.js 0 bytes [compared for emit] [minimized] (name: main)
./src/index.js 1 bytes [built] [code generated]
webpack 5.3.1 compiled successfully in 169 ms
lucaswerkmeister added a commit to lucaswerkmeister/ACDC that referenced this issue Mar 11, 2021
webpack v5 puts license comments into a separate file by default, which
is not a great idea if we only upload one file; explicitly configure the
relevant plugin to not extract comments.

This unfortunately emits a deprecation warning from stats-webpack-plugin
(unindented/stats-webpack-plugin#38).
@jackqqxu
Copy link

same problem

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants