I'm trying to build a modular application in Vue via the `vue-cli-service`. The main app and the modules are separated projects living in different folders, the structure is something like this:

```
-- app/package.json
      /src/**
-- module1/package.json
          /src**
-- module2/package.json
          /src**

```

The idea is to have the Vue app completely agnostic about the application modules that can be there at runtime, the modules themself are compiled with `vue-cli-service build --target lib` in a local `moduleX/dist` folder, pointed with the package.json "main" and "files" nodes.

My first idea (now just for development speed purposes) was to add the modules as local NPM packages to the app, building them with a watcher and serving the app with a watcher itself, so that any change to the depending modules would (I think) be distributed automatically to the main app.

So the `package.json` of the app contains dependencies like:

```
...
"module1": "file:../module1",
"module2": "file:../module2",
...

```

This dependencies are mean to be removed at any time, or in general be composed as we need, the app sould just be recompiled and everything should work.

I'm trying to understand now how to dynamically load and activate the modules in the application, as I cannot use the dynamic import like this:

```
import(/* webpackMode: "eager" */ `module1`).then(src => {
    src.default.boot();
    resolve();
});

```

Because basically I don't know the 'module1', 'module2', etc...

In an OOP world I would just use dependency injection retrieving classes implementing a specific interface, but in JS/TS I'm not sure it is viable.

There's a way to accomplish this?