- Notifications
You must be signed in to change notification settings - Fork7
Angular builder that allows Terser (Uglify) customization
License
fxlrnrpt/angular-builder-custom-terser-options
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Custom Angular builder that allows Terser (Uglify) customization. It's a sub-class of Angular's default builder and it does a very small customization of its logic by extending final webpack config with your custom options for Terser.
This project is not maintained. Tryhttps://github.com/just-jeb/angular-builders instead
Install
npm i -D angular-builder-custom-terser-optionsFor a builder compatible with Angular 7 run
npm i -D angular-builder-custom-terser-options@1Add builders from this package to your
angular.json.- Set
projects.yourProjectName.architect.buildtoangular-builder-custom-terser-options:browser-custom-terser - Set
projects.yourProjectName.architect.build.configurations.production.optimizationtotrue - Set
projects.yourProjectName.architect.build.configurations.production.terserOptionsto an object with any minify options supported by Terser. You can find the list of available optionshere. - Set
projects.yourProjectName.architect.servetoangular-builder-custom-terser-options:dev-server-custom-terser
{// ... rest of the default config ,"projects":{"yourProjectName":{"architect":{"build":{// Set our custom builder here"builder":"angular-builder-custom-terser-options:browser-custom-terser","options":{// Your default options. Leave it as is},"configurations":{"production":{// Add any options supported by Terser here"terserOptions":{"keep_classnames":true},// Enable optimization to enable Terser itself"optimization":true}}},"serve":{// Set our custom builder here"builder":"angular-builder-custom-terser-options:dev-server-custom-terser"// Rest of the config. Leave it as is}}}}}
- Set
If you settarget in your tsconfig.json toes6 or higher, set yourterserOptions to{ "keep_classnames": true }.If you settarget in your tsconfig.json toes5, set yourterserOptions to{ "keep_fnames": true }.
About
Angular builder that allows Terser (Uglify) customization
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.