Skip to content
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

Support using plugin instance in multiple webpack configs #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

th0r
Copy link

@th0r th0r commented Feb 17, 2017

Fixes #10

Currently if you use this plugin in multi-config webpack configuration it will generate/validate dll bundles N times in parallel where N is the number of configs.

This PR solves it: just create one instance of DllBundlesPlugin and use it in multiple configs.
It won't generate/validate bundles if this process has already been started.
For example, can be helpful during migration from Angular 1 to Angular 2 with something like that:

webpack.config.js:

var vendorBundlePlugin = new DllBundlesPlugin({
  dllDir: ...,
  // Libraries that can be used in both ng1 and ng2 apps
  bundles: {
    vendor: ['angular', 'lodash', 'moment']
  },
  webpackConfig: ...
});

var ng1Config = {
  ...
  plugins: [vendorBundlePlugin],
  ...
};

var ng2Config = {
  ...
  plugins: [vendorBundlePlugin],
  ...
};

return [ng1Config, ng2Config];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant