I m using typescript 2.3 and trying to export a simple const and using it in another file (i have done this countless times in es6). somehow it is not working and i have no idea whats wrong? here is the code:
export const abc: string = "dd"; (ts1.ts)
import { abc } from './ts1'; (ts2.ts)
in chrome, in the translated ts1.js file it is showing "uncaught syntax error; unexpected token export." here is my tsconfig file if that helps:
{
"compileOnSave": true,
"compilerOptions": {
"allowJs": false,
"module": "es6",
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"target": "es5",
"types" : []
},
"include": [
"app",
"tests"
],
"exclude": [ "content", "node_modules", "bower_components", "Scripts" ],
"typeAcquisition": {
"enable": true
}
can some one plz help me out?
Its works flawlessly you can try checking your polyfills
working link