Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Angular builder that allows Terser (Uglify) customization

License

NotificationsYou must be signed in to change notification settings

fxlrnrpt/angular-builder-custom-terser-options

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

Quick start

  1. Install

    npm i -D angular-builder-custom-terser-options

    For a builder compatible with Angular 7 runnpm i -D angular-builder-custom-terser-options@1

  2. Add builders from this package to yourangular.json.

    1. Setprojects.yourProjectName.architect.build toangular-builder-custom-terser-options:browser-custom-terser
    2. Setprojects.yourProjectName.architect.build.configurations.production.optimization totrue
    3. Setprojects.yourProjectName.architect.build.configurations.production.terserOptions to an object with any minify options supported by Terser. You can find the list of available optionshere.
    4. Setprojects.yourProjectName.architect.serve toangular-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}}}}}

Common use-cases

Keep class names

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

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp