speed-measure-webpack-plugin
speed-measure-webpack-plugin copied to clipboard
Supports webpack5 and mini-css-extract-plugin
Supports webpack5 and mini-css-extract-plugin, with the following 3 changes:
- Cancel proxy for the parameters of the
tap/tapAsync/tapPromisefunction, as mini-css-extract-plugin will use thecompilationparameter passed to the tap function(code here), but it will get the proxy object instead of itself, which causes some bugs. - Cancel the proxy for all methods of the
compilerfor a similar reason as the first one, as some plugins require the original method, such asmini-css-extract-plugin, which usescompile.webpackas the cache. code here - Replace webpack5 incompatible
normal-module-loaderhook, although it can still be used now, it will be removed in the future.
I ran through all the test cases and it seems to be okay. I hope it helps :)
Worked for me - thanks! In case this repo is still maintained, this should definitely be merged. @stephencookdev
Why don't you merge it? @stephencookdev
@stephencookdev merge please
For those who can't run the plugin on the 5th webpack:
- Clone the @sunft1996 repo https://github.com/sunft1996/speed-measure-webpack-plugin-source-read/tree/webpack5
- Go the repo dir
- Checkout the needed branch: it is the
webpack5branch npm ciin the directory to get the dependencies (install nodejs of needed version if you don't have one or fix the.nvmrc)- Go to your project directory
- Run the
npm i --save-dev <path_to>/speed-measure-webpack-plugin-source-readcommand
For example, in my case, it was the npm i --save-dev ../speed-measure-webpack-plugin-source-read because it was an adjacent directory.
After that you will be able to run the plugin even with the webpack@5
FYI @tanchu
@sunft1996 Great effort, man. You helped a lot.
@sharikovvladislav Thanx!
@sunft1996 can you use npx publish-to-git to publish a version to your repo? Then we will be able to install as such https://www.npmjs.com/package/publish-to-git#consumption-of-private-git-npm-packages