无法动态转换ES模块System.config({transpile:'transpile-module'})

Ole*_*zov 7 javascript angularjs

这是我的tsconfig.js

{
"compilerOptions": {
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "moduleResolution": "node",
    "target": "es5",
    "module": "system",
    "noImplicitAny": false,
    "outDir": "built",
    "rootDir": ".",
    "sourceMap": false
},
"exclude": [
    "node_modules"
]
Run Code Online (Sandbox Code Playgroud)

}

我正在使用tsc命令将'hello-angular.ts'转换为'hello-angular.js' .并导入System.import ('built/hello-angular')

当我启动服务器时,我在浏览器Unable to dynamically transpile ES module A loader plugin needs to be configured viaSystemJS.config中遇到了错误 ({transpiler:'transpiler-module'})``

我不明白,为什么systemjs试图转换es5文件..我设置system.config({transpiler:false}),但它没有帮助..

pix*_*its 1

在 tsconfig.json 中尝试以下操作:

"module": "commonjs",
Run Code Online (Sandbox Code Playgroud)