我有包含命名模块的index.js
System.register('app/bootstrap', ['./router'], function() {
return {
setters: [...],
execute: function() {...}
});
System.register('app/router', function() {
return {
setters: [...],
execute: function() {...}
});
我尝试在index.html中导入app / bootstrap模块
<html lang="en">
<head>
...
<script src="/index.js"></script>
</head>
<body>
System.config({
baseURL: "/",
defaultJSExtensions: 'js',
transpiler: false,
packages: {
'app': {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('app/bootstrap').then(null, console.error.bind(console));
</body>
</html>
我看到模块位于变量System.defined中,但systemjs发出了对URL /app/bootstrap.js的请求。也许是SystemJs中的一个错误?