-
Notifications
You must be signed in to change notification settings - Fork 80
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
Fixed: Two AutoDLLPlugin's overwrite each other #30
Comments
Hi, @cgatian Thanks for reporting. |
BTW, would you mind sharing what your use case was for more than one instance of the plugin? |
@asfktz we were considering migration to this plugin instead of the The setup this webpack starter has basically outlines what we were trying to do. They create two DLL bundles, one for polyfills and a second for vendor. My understanding is, since DLLs should only really be used during development creating two instances really has no benefit. (Please correct me if I'm wrong) |
I've anticipated this issue in #13 but does not have a fixture yet. Adding a fixture for this functionality would be a good start so we can test it thoroughly. :) |
@cgatian turns out that using DLL in production is not a bad idea. I forked your project to better understand your use case. I don't see more than one instance of DllBundlesPlugin in there. I do see two bundles, polyfills and vendor, but that should be no problem with AutoDllPlugin. I see that you have separate configs for each environment, But it will trigger a rebuild currently. it will be fixed soon. I plan to fix the multiple instances bug anyway. I noticed that when I replace DllBundlesPlugin with AutoDllPlugin: new AutoDllPlugin({
debug: true,
inject: true,
context: helpers.root(),
filename: '[name]_[hash].js',
path: './dll',
entry: {
polyfills: [
'core-js',
'zone.js/dist/zone.js',
'zone.js/dist/long-stack-trace-zone'
],
vendor: [
'@angular/platform-browser',
'@angular/platform-browser-dynamic',
'@angular/core',
'@angular/common',
'@angular/forms',
'@angular/http',
'@angular/router',
'@angularclass/hmr',
'rxjs',
]
}
}), An error is thrown on
I plan to investigate it. |
@asfktz yes they can be used in production in very clever scenarios. However, I believe when you're actually using them in production youre going to want to be very strategic in how the DLLs are built. Something I dont think should be totally automated by a package, but on a case by case basis. Thanks for taking a look. 👍 |
@asfktz I think because autodll-webpack-plugin depends on webpack
|
Hi @taehwanno, Interesting, even if I set webpack as a "peerDependencies": {
"webpack": ">= 2.0.0"
} I still get this error on angular-starterkit. But like in your case, upgrading to webpack I'll dive into it to see what I can do to fix it from my side. @cgatian also wanted you to know that your original issue with the multiple instances was fixed in 0.1.0 |
@taehwanno are you using I noticed that it works with webpack I released a new version. webpack is now a peerDependency. |
Nope. When I retry autodll-webpack-plugin with |
@taehwanno oh, that's good news (: |
@cgatian is updating to webpack |
I was trying this in webpack 3. Haven't tried since you released the new
version.
…On Wed, Jul 12, 2017, 10:38 AM Asaf Katz ***@***.***> wrote:
@cgatian <https://github.com/cgatian> is updating to webpack v3 an option
for you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABq8agypnYWP8QGKxxBUwt7vo3hugGzKks5sNNpIgaJpZM4OP6OR>
.
|
@cgatian I already did it in my fork, so I created a PR for you to use if you like: |
Just want to add that double instances of the plugin could also be relevant when using the multi compiler feature of Webpack. We use that for efficient SSR (universal) bundling. See also #43 I would be fine to pass over some specific naming for the caching/output. I does the same already for webpacks new Cache-Loader: {
loader: "cache-loader",
options: {
cacheDirectory: resolve(ROOT, `.cache/loader-${CACHE_HASH}-${config.target}-${config.env}`)
}
} |
Trying to utilize this plugin and found that when you add two AutoDLLPlugins to the webpack config the last one wins in creating a manifest in .cache.
To reproduce add two plugins, and attempt a build.
The text was updated successfully, but these errors were encountered: