-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not respect DllReferencePlugin, leading to oversized bundles #109
Comments
I feel honored to receive a bug report from @SteveSandersonMS! I have been a long time user of Knockout and it's a great framework, even to this day! You were a precursor in this area :) Webpack I see you've tried to use Unless there is a problem with the plugin itself, in that case it might be better to open an issue in the |
I wonder if the duplication is because the DLL is bundling the commonjs dist while AureliaPlugin is picking out the es2015 ones? From the looks of things the DLL setup is largely the same as the other templates. However, the Angular one specifies the source type: https://github.com/aspnet/JavaScriptServices/blob/dev/templates/AngularSpa/webpack.config.js#L58 |
@MeirionHughes I'm not all too familiar with the CLI templates but the DLL should be built with AureliaPlugin as well, at least if you're trying to bundle libs that will be loaded with When AureliaPlugin is active, by default If you were to build a DLL without AureliaPlugin or with a different If you want to confirm your suspicion, it's fairly easy to look at the DLL manifest and compare with |
Yes, I found independently that the issue relates to the module types and came here to report it. Note I am also using To test the hypothesis, I changed this line in
to this:
and bingo the dups disappeared. However, after doing that, when the app runs it no longer enters into the aurelia-bootstrapper (and a bunch of "hot" related stuff seems to have appeared in the bundle that wasn't there before). So, to fix that, I added this to
And now things work. However, a better solution would be to modify the vendor bundle to use To achieve that I reverted
and changed this in
And voila, everything is So there may be a documentation issue here, as well as an issue with I wonder to whom this should be reported in the realm of the CLI? |
I had the same issue. Including the AureliaPlugin in the vendor Webpack config did the 'trick'. I wonder how you can force webpack to use a specific module format when specifying modules in a configuration file. I cannot find anything in the WebPack documentation. |
Two notes that are pointed out in the wiki about DLL:
If the templates generated by Aurelia CLI don't follow these patterns they should be updated. Given 2., I'm surprised libraries do not resolve to the same distribution? |
Sorry my first comment wasn't very good. The bottom line is that the DLL (vendor) bundle config is missing this: @arjendeblok you can add |
OK so it seems the problem here is that the CLI template for DLL config is incomplete. @dkent600 PS: There are other under-the-hood reasons why including |
@dkent600 the whole wiki is a good read if you're using Aurelia + Webpack ;) |
FYI I have altered the behavior in RC3. When a Using |
I'm submitting a bug report
2.0.0-rc.2
Please tell us about your environment:
Operating System:
Windows 10
Node Version:
6.10.3
3.10.10
webpack 2.5.1
Browser:
all
Language:
TypeScript 2.3.2
Current behavior:
When using
aurelia-webpack-plugin
in a Webpack setup that includes DLL references,aurelia-webpack-plugin
disregards the DLL references and bundles its own copy of all Aurelia modules instead of taking the modules from the DLL bundle. This means the resulting bundle contains duplicate copies of the Aurelia modules and is much bigger than necessary.REPRO:
Use the
dotnet new aurelia
tool to create a new ASP.NET Core Aurelia application (@MeirionHughes knows how to do this - he set up the current version of that template).Create a production build using
webpack --config webpack.config.vendor.js --env.prod
thenwebpack --env.prod
Notice that the Aurelia modules are included in both the
vendor.js
file (450KB) and theapp.js
file (343KB). Thisapp.js
file is massive compared with what you'd get from other frameworks - the Angular/React/Vue/etc versions are around 20-30KB, because they all work with webpack'sDllReferencePlugin
.What is the expected behavior?
Should respect
DllReferencePlugin
and therefore not duplicate the Aurelia modules.Producing reasonably-sized production builds, while retaining fast dev-time builds.
The text was updated successfully, but these errors were encountered: