How can I compile Angular 10 libraries to ES2016?

你离开我真会死。 提交于 2020-07-10 10:26:59

问题


I'm making the decision to no longer support legacy browsers AT ALL and dropping support for ES5 compilation/polyfills.

I have my Angular project code compiling for ~85% coverage to

"compilerOptions": {
    "target": "es2016",
    "module": "es2020",
    "lib": [
        "es2019",
        "dom"

These options control the project's code.

However, Angular libraries compile to ES2015.

How can we compile our project's packages to ES2016/17/18/19/20?


回答1:


According to this stackoverflow post ES6 as the typescript target compiler option for angularjs or angular2

it seems like "target": "es6" will do your task.



来源:https://stackoverflow.com/questions/62645152/how-can-i-compile-angular-10-libraries-to-es2016

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!