我正在尝试使用 Angular 中的 SystemJs 导入外部模块
import { System } from 'systemjs';
declare const SystemJS: System;
...
SystemJs.import('./assets/example/example.js').then(m=>{
console.log('the module is', m);
});
我也试过 http://localhost:4200/assets/example/example.js
js 文件在那里并且可以访问。
但我收到一个错误:
ERROR Error: Uncaught (in promise): Error: Cannot find module 'http://localhost:4200/assets/example/example.js'
我在一个干净的项目中尝试过它,它工作正常,所以我认为问题可能与某些特定角度的配置有关。
关于什么可能是错的任何线索?