Build failing for IE 11
See original GitHub issueHi!
I also noticed some problem with the transpilation build, I digged a bit into it, I have @ngforage/ngforage-ng5
installed in my package.json and I noticed some weird stuff, during transpilation of @angular/common
the source code is taken from esm5
directory while for this ng-forage
package it is taken from esm2015
and it causes my build to fail in IE11 because I get the code that contains class
syntax, also as far as I remember I’ve also seen some code from zone.js to also not being transpiled properly. Could someone explain to me how does the resolving of package main file work ? It is very weird to me as every package, but the one mentioned above seems to transpile properly. I checked package.json of if and it looks fine:
…
"es2015": "dist/esm2015/index.js",
"homepage": "https://github.com/Alorel/ngforage",
"jsdelivr": "dist/umd/index.min.js",
"license": "MIT",
"main": "dist/es5/index.js",
"module": "dist/esm5/index.js", <--- looks fine
"name": "@ngforage/ngforage-ng5",
Versions
Angular CLI: 1.6.5
Node: 9.3.0
OS: win32 x64
Angular: 5.2.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.6.5
@angular-devkit/build-optimizer: 0.0.41
@angular-devkit/core: 0.0.28
@angular-devkit/schematics: 0.0.51
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.5
@schematics/angular: 0.1.16
typescript: 2.6.2
webpack: 3.10.0
Repro steps
- create project
- npm install --save @ngforage/ngforage-ng5
- ng build --prod
OR
- clone https://github.com/zaalbarxx/angular-ie11test
- ng build --prod
Observed behavior
main.js file contains code with class
keyword and the code from ngforage-ng5 is in ES6 version even though it should not
Desired behavior
main.js file should contain /dist/esm5/ version of ng-forage which is ES5 and IE11 ready
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:14 (1 by maintainers)
Top GitHub Comments
I encountered the same problem importing
es6
version of Swiper: vendors bundle containsclass
keyword even if I’m targetinges5
. Just a workaround for the case if you have the opportunity:src/typings.d.ts
and DON’T import modules or declarations inside any.ts
file.This worked for me, hope it works also for someone else until this issue will be solved.
+1