ES2015 problem since Angular 8
See original GitHub issueType of Issue
[x] Bug Report
[ ] Feature Request
Description
I have upgraded my apps to Angular 8, but if I use es2015 as target in tsconfig.json and use a browser with es2015 support, then the lib is not working correctly (see How to reproduce).
How To Reproduce
Take a look at my repo: https://github.com/paulstelzer/ngxs-issue
There are two branches: master and language. The difference between the two: Inside language branch, the source code is directly in the app. In master I am using the lib created with ng-packagr.
If you now build the repo with production (ng build --prod) a ES5 and ES2015 files will be created (the default since Angular 8).
If you now run the master branch (which is using the lib created with ng-packagr) and ES2015 the lib isn’t working anymore. You can see it because the log “LANGUAGE checkLanguage” will not be shown in console. If you remove the es2015 part from index.html, the app is working again.
If you use the language branch (without a lib built with ng-packagr), ES2015 is working.
If you only build ES5, also the master branch with the lib built with ng-packagr will work.
For me it seems that ng-packagr made somehting that it’s not working in ES2015
Expected Behaviour
Lib should work with ES2015 builded application
Version Information
$ node_modules/.bin/ng-packagr --version
ng-packagr: 5.2.0
@angular/compiler: 8.0.0
rollup: 1.12.5
tsickle: 0.35.0
typescript: 3.4.5
node: 10.12.0
npm: 6.9.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (5 by maintainers)
Top GitHub Comments
@DenisSemionov, the issue is within build-optimizer. See: https://github.com/angular/angular-cli/issues/14613#issuecomment-498960867
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. This action has been performed automatically by a bot.