webpack remove module dynamically

602 Views Asked by At

I am working on an library, where we want to use one module out of 2 modules. And the application's configuration will decide which module to use. I tried to dynamically load one of the module dynamically but nothing worked. So, i am trying to import both of them at start and remove one dynamically, if possible. Is it possible to dynamically remove the module from library? or can i dynamically add one module in the library?

I am working on Angular 7, ng-packager is creating the library, webpack is the module bundler and the application will run with AOT compilation.

1

There are 1 best solutions below

0
On

I'm not sure, but maybe you can experiment by ignoring one of them, this tool might help ignore