问题
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