Reputation: 16675
Using Angular 2, I'm getting a warning in Chrome console:
TypeScript [Warning] transpiling to CommonJS, consider setting module: "system" in typescriptOptions to transpile directly to System.register format
I've serached the web thoroughly but couldn't find a solution or an article about this issue.
I did find this site, that mentions using:
--allowSyntheticDefaultImports (boolean)
as
module === "system"
I added to my tsconfig.json
file:
{
"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"
}
}
But it did not help.
Any suggestions ?
Upvotes: 2
Views: 893
Reputation: 136144
You could set module
to system
option by setting compilerOptions
of of tsconfig.json
option.
tsconfig.json
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"module": "system",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true
}
}
Also you can do the same via command line by adding --module system
in your command args.
Upvotes: 3