shlomiassaf/webpack-dll-bundles-plugin

[Question] Use generated library bundles in multiple webpack configs

Opened this issue · 1 comments

th0r commented

Hi! Thanks for a great plugin!

Here is my problem: we are migrating our app from ng1 to ng2 and have two webpack configs.
First one contains two bundles: app and vendor.
Second one has everything related to ng2 app (angular2, *.ts files and ng2 templates).

The thing is all vendor libs are located in the first config and ng2-config doesn't know anything about them but it should: it needs access at least to ng1.
One way to solve it is use webpack externals and export all this libs into global scope but I don't like it much.

So I decided to try your plugin but the thing is I need to share one instance of DllBundlesPlugin in two webpack configs.

What I do now is saving it into a variable (var dllBundlesPlugin = new DllBundlesPlugin(...)) and adding it as plugin into both configs.

So my question is is it the right way to use it because now I see duplicating logs DLL: Rebuilding..., DLL: Checking if DLLs are valid etc.

How this plugin handles such cases? Does it build dll bundle only once or two builds are being done in parallel?

th0r commented

Submitted PR that supports this use-case.