Angular-CLI v8 implemented differential loading. But I don't need files built by es5. I want to decrease deploy quantity.
I tried below. But CLI has generated es5 files.
es5browsersupport: false
in angular.json, and got error.How To Disable Differential Loading in Angular Applications. Adjust browserslist to only consider the web browsers that we actually want to support. Ensure that we have specified "target": "es2015" as the target in tsconfig. json .
In a nutshell, differential loading means to send newer, flashier code to newer browsers and stable legacy code to legacy browsers. This generally translates into two things: modern syntax and polyfills.
To enable differential loading, the app must have browserslist configuration. It can be placed in package. json or browserslist file. This configuration has already been used by autoprefixer process of postcss.
In Angular 8 the file browserlist have to be in project root folder. Following entries were needed on my project to disable differential loading:
> 0.5% last 2 versions Firefox ESR not dead not IE 9-11 not samsung 4 not android 4.4.3-4.4.4 not last 2 ie_mob versions not last 2 op_mini versions not last 2 op_mob versions not last 2 baidu versions not last 2 kaios versions not last 2 and_uc versions not last 2 and_qq versions not last 2 edge versions not chrome 49
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With