Angular 11 - only build ES2015 files (no ES5)

本小妞迷上赌 提交于 2021-01-29 22:25:43

问题


Our company is using Angular 11 for one of our webapps. We tried to use the newer Webpack 5, but could not get the builds to work.

What we are trying to achieve, is to remove ES5 build files, since we no longer support IE11 users. We already changed the browserslist file, but ES5 files are still being build.

Is there a general solution to stop ES5 files from being build in Angular 11?


回答1:


I went through the list of supported browsers, building each time a browser was added and with the following browserslist, only ES2015 is targetted.

last 2 Android versions
last 2 Chrome versions
last 2 ChromeAndroid versions
last 2 Edge versions
last 2 Firefox versions
last 2 FirefoxAndroid versions
last 2 iOS versions
last 2 Opera versions
last 2 QQAndroid versions
last 2 Safari versions
last 2 Samsung versions
Firefox ESR

Note that this drops support for any other browser that was in this list by default (>0.5%), including IE11.



来源:https://stackoverflow.com/questions/65699818/angular-11-only-build-es2015-files-no-es5

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