2017-02-22 5 views
1

Angular 2 Verwendung, ich bin eine Warnung in Chrome Konsole bekommen:Typoskript [Warnung] transpiling zu Commonjs betrachten Modul Einstellung: "System" in Typoskript Optionen

Typoskript [Warnung] zu Commonjs transpiling betrachten Einstellungsmodul: "system" in typescriptOptionen direkt in das System.register-Format

Ich habe das Internet gründlich durchsucht, konnte aber keine Lösung oder einen Artikel zu diesem Problem finden.

habe ich this Website finden, die mit Nennungen:

--allowSyntheticDefaultImports (boolean) 

als

module === "system" 

ich meine tsconfig.json Datei hinzugefügt:

{ 
    "compilerOptions": { 
    "target": "es5", 
    //"module": "commonjs", 
    "moduleResolution": "node", 
    "sourceMap": true, 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "noEmitHelpers": true, 
    "lib": [ "es2015", "dom" ], 
    "noImplicitAny": true, 
    "suppressImplicitAnyIndexErrors": true, 
    "allowSyntheticDefaultImports": true, 
    "module": "system" 
    } 
} 

Aber es half nicht.

Irgendwelche Vorschläge?

Antwort

2

Sie könnten module auf system Option durch Einstellung compilerOptions von tsconfig.json Option setzen.

tsconfig.json

{ 
    "compilerOptions": { 
     "allowSyntheticDefaultImports": true, 
     "module": "system", 
     "noImplicitAny": true, 
     "removeComments": true, 
     "preserveConstEnums": true, 
     "sourceMap": true 
    } 
} 

Finden tsconfig.json docs here

Auch können Sie das gleiche über die Kommandozeile tun, indem --module system in Ihrem Befehl args hinzufügen.

+0

tritt das Problem nicht lösen - siehe bitte editierten Nachricht –

+0

@KobyDouek versuchen Kommentar entfernen ('// "Modul": "Commonjs",') von 'tsconfig.json'.It macht JSON ungültig ist. –

0

Es sollte tsconfig.json enthalten Sie die Einstellungen und Konfigurationen für Typoskript transpilation prüfen here gehen.

"compilerOptions": { 
    "allowSyntheticDefaultImports": true, 
     "module": "system", 

    //other settings 
    } 
+0

Löst das Problem nicht - siehe bitte editierten Beitrag –