Closed
Description
I need to emit non-downlevel ES6 code to feed into another tool in the toolchain.
However, I want to ensure that the project includes only ES5 library code, because there are no runtime polyfills nor does the 6-to-5 tool do any API conversions.
So, I want simply tsc --target es6 --noLib node_modules/typescript/lib/lib.d.ts app.ts
but this doesn't work:
$ ./node_modules/.bin/tsc
error TS2318: Cannot find global type 'Iterable'.
error TS2318: Cannot find global type 'IterableIterator'.
error TS2318: Cannot find global type 'Iterator'.
error TS2318: Cannot find global type 'Symbol'.
error TS2468: Cannot find global value 'Symbol'.
I've followed #4692 but I wonder if there is another answer for this.
Repro
tsconfig.json
"compilerOptions": {
"target": "es6",
"noLib": true,
"noImplicitAny": false,
"outDir": "built",
"rootDir": ".",
"sourceMap": false
},
"exclude": [
"node_modules"
],
"files": [
"app.ts",
"node_modules/typescript/lib/lib.d.ts"
]
}
app.ts
let a: string = "hello";