Can we use System.import or import() function to any Javascript file or only Single module specific js?

Following a great article on dynamic component loading:

https://blog.angularindepth.com/here-is-what-you-need-to-know-about-dynamic-components-in-angular-ac1e96167f9e

I want to know more about the use of System.import.
The author uses a following syntax to load the javascript file of the module to be dynamically loaded.

System.import('../module1.module.js').then((module) => {
          this.compiler.compileModuleAndAllComponentsAsync(module.Module1Module)
              .then((compiled) => {
                  const factory = compiled.componentFactories[0];
                  this.container.createComponent(factory);
              });
      });

I understand that system.import is used to dynamically load modules at run time.

And in our case, we provide the name of the ts of the module file but because the js file will be also of same name we can provide that in the parameters of import function.

But I was wondering if we could provide a generic JS file in the parameter which not necessarily contains that module but more modules and components also. (These modules can come from other external projects/libraries)
And then we can provide one of the module name like following and create components.

System.import('../main-app1.js').then((module) => {
          this.compiler.compileModuleAndAllComponentsAsync(module.Module1Module)
              .then((compiled) => {
                  const factory = compiled.componentFactories[0];
                  this.container.createComponent(factory);
              });
      });

I have tried above approach but it does not works for me.It fails at run time.

core.js:9110 ERROR Error: Uncaught (in promise): Error: No NgModule metadata found for 'undefined'.
Error: No NgModule metadata found for 'undefined'.

Source: New feed
Source Url Can we use System.import or import() function to any Javascript file or only Single module specific js?