Building angular custom elements into separated bundles where all vendors (dependencies) are placing in a separate file

For example, I have 2 bundles with custom elements: a.js, b.js

For each element I have own compiler (a-main.ts, b-main.ts) which bootstraps the module I need (AModule.ts, BModule.ts).

{a,b}.js is result of: runtime.js and main.js. Then I have common.js, which is result of vendors.js and pollyfils.js of each build of custom elements.

As result, I have 2 files with custom elements and 1 file with pollyfills and vendors with own module scope for each custom element (fst scope for a, scnd scope for b).

Is there any solution how I can exclude duplicated code of dependencies and angular core from common.js?

Read more here:

Content Attribution

This content was originally published by Dmitrijs at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: