closure-webpack-plugin
closure-webpack-plugin copied to clipboard
Chunks are not processed
I have a minimal React setup here that outputs three chunks (runtime, common, and main). The plugin seems to only process the main chunk and output blank for the others.
Any progress on this?
What's the error you're getting on this? I'm getting what I think is an error similar to what you see:
/Users/tjohnston/source/rent-js/node_modules/closure-webpack-plugin/src/closure-compiler-plugin.js:1086
chunk.hasEntryModule()
^
TypeError: Cannot read property 'hasEntryModule' of undefined
at ClosureCompilerPlugin.getChunkName (/Users/tjohnston/source/rent-js/node_modules/closure-webpack-plugin/src/closure-compiler-plugin.js:1086:13)
at /Users/tjohnston/source/rent-js/node_modules/closure-webpack-plugin/src/closure-compiler-plugin.js:673:22
I'm only getting this in AGGRESSIVE_BUNDLE
, not STANDARD
.
Problem are still actual. No error messages are reported, plugin just dont process any chunk except main one.
Simple repository (based on webpack guides), where this problem can be reproduced, can be found here.
Webpack would generate two chunks:
- main.js which is minified by google closure compiler;
- 1.main.js, not minified at all.
I investigated this issue, and it comes to this line: https://github.com/webpack-contrib/closure-webpack-plugin/blob/915ae0ced7787b3a9fe2339f46530f20577f58d6/src/closure-compiler-plugin.js#L469
If one removes that block, all chunks would be minimized. It is a pity that the developers did not find time to take a look for such trivial thing in two years.