Closed smax48 closed 7 years ago
You might need to configure CommonsChunkPlugin differently.
Does the same error occur when you make the entry chunk vendors empty?: 'vendors': []
I would like to if I knew how exactly differently :) Yes, when I make the vendors chunk empty, I get the same error. Interestingly, that the bundles are generated and my app bundle contains all resources from the bridge that are specified in both my app project.json (despite the "bundle" property) and in the bridge's...
I'll look into this, but can't promise a timeframe. Try reading up on CommonChunksPlugin, I'm not sure if the default config from easy-webpack handles this use case. As a workaround, try lazy-loading the resources instead of specifying a separate entry bundle:
{"path": "aurelia-kendoui-bridge", "bundle": "vendors", "lazy": true}
Might need to be done for the sub-resources too, not sure.
Thanks! I will try different configuration options for CommonChunksPlugin. The problem is that I don't know what aurelia-webpack plugin does with resources defined in package.json of external modules (in my case, aurelia-kendoui-bridge) - at the moment they are bundled with app code for some reason...
Unfortunately, I was unable to configure CommonsChunkPlugin in the way that it puts all aurelia-kendoui-bridge resources into a non-app bundle. I tried a lot of different configuration variants, but result was always the same (either resources end up in the app chunk or I get "ERROR in CommonsChunkPlugin: While running in normal mode it's not allowed to use a non-entry chunk").
It seems that the "bundle" property for aurelia resources just doesn't work in the case of non-lazy resources.
Your workaround does produce a separate chunk with resources, but the app crashes at runtime when it tries to load it...
I'm submitting a bug report
Please tell us about your environment:
Current behavior: I am using aurelia-kendoui-bridge 1.0.0-beta.1.0.13 and want to bundle all it's resources into a separate bundle (with the name "vendors"). The bridge itself has it's own "aurelia/build/resources" section with common resources. For some reason, they are bundled into the app bundle, not the bundle for the bridge that I specified. Non-resource bridge's components (referenced from its main) are bundled correctly into the "vendors" bundle. If I specify additional resources from the bridge (either in the resources section of my app or using) - they also go into the app bundle. If I specify resources in the form:
Then I get the following error on npm run build:
I started off my project from the latest aurelia-webpack-typescript skeleton. Extract from my webpack config:
Expected/desired behavior: All external module's resources are bundled together with that module in the specified bundle