Transpile To ES5 Corrupt JS Library In Angular 6 Project
I am trying to use Dygraph library in an Angular 6 project. It works perfectly in Chrome / FF, however it does not work in IE11. I installed the library through npm, and installed
Solution 1:
Turns out that, as recommended by jfriend00, the configuration needed to be:
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es5",
"es6",
"dom"
]
}
}
What does lib does is not that clear in the documentation, but it seems that it should list the formats from all source codes to be compiled.
As I have DOM, ES5 and ES6 code, I needed all of them. The template I used only contained only DOM/ES6 code, that is probably why the lib was set to DOM/ES2017 only.
Post a Comment for "Transpile To ES5 Corrupt JS Library In Angular 6 Project"