closure-webpack-plugin icon indicating copy to clipboard operation
closure-webpack-plugin copied to clipboard

Chunks are not processed

Open ghost opened this issue 5 years ago • 5 comments

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.

ghost avatar Mar 18 '19 02:03 ghost

Any progress on this?

saksmt avatar Dec 07 '19 15:12 saksmt

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.

tadjohnston avatar Feb 21 '20 23:02 tadjohnston

Problem are still actual. No error messages are reported, plugin just dont process any chunk except main one.

Grundik avatar Feb 18 '21 01:02 Grundik

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.

Grundik avatar Feb 18 '21 18:02 Grundik

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.

Grundik avatar Feb 19 '21 19:02 Grundik