2017-01-28 17 views
7

To moje tsconfig.jsw stanie dynamicznie transpile ES moduł System.config ({transpile: 'transpile-module'})

{ 
"compilerOptions": { 
    "experimentalDecorators": true, 
    "emitDecoratorMetadata": true, 
    "moduleResolution": "node", 
    "target": "es5", 
    "module": "system", 
    "noImplicitAny": false, 
    "outDir": "built", 
    "rootDir": ".", 
    "sourceMap": false 
}, 
"exclude": [ 
    "node_modules" 
] 

}

jestem transpiling moja „hello-kątowej. ts 'into' hello-angular.js 'przy użyciu polecenia tsc. A import o System.import ('built/hello-angular')

Kiedy im serwer począwszy mam err w przeglądarce Unable to dynamically transpile ES module A loader plugin needs to be configured via SystemJS.config ({transpiler: 'transpiler-module'}) ``

ja nie rozumiem, dlaczego próbuje systemjs do transpile ES5 plik .. I został ustawiony system.config ({transpiler: false}), ale zrobił to pomoże ..

Odpowiedz

-1

Spróbuj wykonać następujące czynności w tsconfig.json:

"module": "commonjs", 
0

I był już taki sam błąd na jednym z p lugins:

Błąd: nie można dynamicznie transplować modułu ES Wtyczka ładująca musi być skonfigurowana przez SystemJS.config({ transpiler: 'transpiler-module' }). instancji http://localhost:62362/node_modules/angular-star-rating/index.js

Rozwiązano ten błąd, zastępując ten wiersz w systemjs.config.js:

'angular-star-rating': { defaultExtension: 'js', main: 'index.js' } 

z tej linii:

'angular-star-rating': { defaultExtension: 'js', main: 'angular-star-rating.umd.js' }