Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to turn off differential loading in Angular v8?

Tags:

angular

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.

  • set es5browsersupport: false in angular.json, and got error.
  • exclude Chrome 41, IE 9-11 and ie_mob 11 from browserList.
like image 574
TeaTwo Avatar asked May 18 '19 09:05

TeaTwo


People also ask

How to disable differential loading in angular?

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 .

What does differential loading in angular 8 refers to?

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.

How do you enable differential loading?

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.


1 Answers

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 
like image 75
Metrophos Avatar answered Sep 21 '22 21:09

Metrophos