DEV Community

Discussion on: "Differential Loading" - A New Feature of Angular CLI v8

Collapse
 
muhammedmoussa profile image
Moussa

I found a package browserlist, and add to package.json :
"browserlist": [
"last 2 version"
];

What the difference?

Thread Thread
 
lacolaco profile image
Suguru Inatomi • Edited
"browserlist": [
"last 2 version"
];

With this configuration, the CLI can recognize all targeted browsers are compatible ES2015. so no differential loading happens. All browsers load es2015 bundles.

If you want to align bundles to es2015, that is correct.
If you want to align bundles to es5, setting target: "es5 is correct.

Thread Thread
 
muhammedmoussa profile image
Moussa

Thank you!

Thread Thread
 
muhammedmoussa profile image
Moussa

i added :

"browserlist": [
"last 2 version"
];

to package.json and got

An unhandled exception occurred: D:\AccFlex_Cloud_Front\accflex-erb contains both browserslist and package.json with browsers
See "C:\Users\m.mousa\AppData\Local\Temp\ng-XowNha\angular-errors.log" for further details.
Thread Thread
 
michaelz profile image
Michaël Zwyssig

either use the browserlist file or the browserlist entry in package.json. You can't use both.