I am writing an import statement import { PI } from './math/circle'
in app.ts file and have a constant export const PI = 3.14
in circle.ts file but on running the program by doing tsc app.ts --outFile app.js
keeps showing this error.
error TS6131: Cannot compile modules using option 'outFile' unless the '--module' flag is 'amd' or 'system'. 1 export const PI = 3.14
But according to the docs I am importing correctly. I have also tried changing the "module": "commonjs" to "module": "amd"/"system" and then reloading the VSCode windows but no luck. Where am I going wrong?
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "amd",
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictPropertyInitialization": false
},
"exclude": [
"node_modules"
]
}
P.S: typescript version 3.5.3