When I build my angular project i see
main-es5.js
and main-es2015.js
both files. I just want to support only Chrome browser how can I turn off building the old js files I want minimum number of files on Build.
My Build also runs twice since I upgraded to 8
Note
Build time has significantly increased and i get the warning WARNING in budgets, maximum exceeded for initial.
This is my Angular.json File
"optimization": true,
"outputHashing": "none",
"sourceMap": true,
"extractCss": false,
"namedChunks": false,
"showCircularDependencies": false,
"aot": true,
"extractLicenses": false,
"statsJson": false,
"progress": true,
"vendorChunk": false,
"buildOptimizer": true,
browserlist file
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# You can see what browsers were selected by your queries by running:
# npx browserslist
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
Edit: Raised feature request on Github
The ng build command is intentionally for building the apps and deploying the build artifacts. The command does not generate an output folder. The output folder is – dist/. The ng serve builds artifacts from memory instead for a faster development experience.
Recent versions of Angular supports all latest versions of all major browsers like Firefox, Chrome, Safari, iOS and Android.
ng build now uses the production configuration by default. You no longer need to pass the --prod option to the command.
As per @clydin 's comment on GitHub
**browserlist**
last 2 Chrome versions
https://browserl.ist/?q=last+2+Chrome+versions
Creates a minimal chrome only ES2015+ build
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