{"id":16368781,"url":"https://github.com/aigoncharov/angular-builder-custom-terser-options","last_synced_at":"2025-03-21T01:31:20.002Z","repository":{"id":43601049,"uuid":"171665201","full_name":"aigoncharov/angular-builder-custom-terser-options","owner":"aigoncharov","description":"Angular builder that allows Terser (Uglify) customization","archived":false,"fork":false,"pushed_at":"2023-01-07T03:14:41.000Z","size":1510,"stargazers_count":21,"open_issues_count":23,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-12T02:53:43.433Z","etag":null,"topics":["angular","builder","terser","uglify"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aigoncharov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-20T12:00:43.000Z","updated_at":"2024-04-02T17:40:20.000Z","dependencies_parsed_at":"2023-02-06T11:01:28.566Z","dependency_job_id":null,"html_url":"https://github.com/aigoncharov/angular-builder-custom-terser-options","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aigoncharov%2Fangular-builder-custom-terser-options","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aigoncharov%2Fangular-builder-custom-terser-options/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aigoncharov%2Fangular-builder-custom-terser-options/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aigoncharov%2Fangular-builder-custom-terser-options/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aigoncharov","download_url":"https://codeload.github.com/aigoncharov/angular-builder-custom-terser-options/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221810762,"owners_count":16884188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","builder","terser","uglify"],"created_at":"2024-10-11T02:53:46.795Z","updated_at":"2024-10-28T08:59:51.309Z","avatar_url":"https://github.com/aigoncharov.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# angular-builder-custom-terser-options\n\nCustom 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.\n\n**This project is not maintained. Try https://github.com/just-jeb/angular-builders instead**\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [Quick start](#quick-start)\n- [Common use-cases](#common-use-cases)\n  - [Keep class names](#keep-class-names)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Quick start\n\n1. Install\n\n   ```\n   npm i -D angular-builder-custom-terser-options\n   ```\n\n   \u003e For a builder compatible with Angular 7 run `npm i -D angular-builder-custom-terser-options@1`\n\n1. Add builders from this package to your `angular.json`.\n\n   1. Set `projects.yourProjectName.architect.build` to `angular-builder-custom-terser-options:browser-custom-terser`\n   1. Set `projects.yourProjectName.architect.build.configurations.production.optimization` to `true`\n   1. Set `projects.yourProjectName.architect.build.configurations.production.terserOptions` to an object with any minify options supported by Terser. You can find the list of available options [here](https://github.com/terser-js/terser#minify-options).\n   1. Set `projects.yourProjectName.architect.serve` to `angular-builder-custom-terser-options:dev-server-custom-terser`\n\n   ```js\n   {\n     // ... rest of the default config ,\n     \"projects\": {\n       \"yourProjectName\": {\n         \"architect\": {\n           \"build\": {\n             // Set our custom builder here\n             \"builder\": \"angular-builder-custom-terser-options:browser-custom-terser\",\n             \"options\": {\n               // Your default options. Leave it as is\n             },\n             \"configurations\": {\n               \"production\": {\n                 // Add any options supported by Terser here\n                 \"terserOptions\": {\n                   \"keep_classnames\": true\n                 },\n                 // Enable optimization to enable Terser itself\n                 \"optimization\": true\n               }\n             }\n           },\n           \"serve\": {\n             // Set our custom builder here\n             \"builder\": \"angular-builder-custom-terser-options:dev-server-custom-terser\"\n             // Rest of the config. Leave it as is\n           }\n         }\n       }\n     }\n   }\n   ```\n\n## Common use-cases\n\n### Keep class names\n\nIf you set `target` in your tsconfig.json to `es6` or higher, set your `terserOptions` to `{ \"keep_classnames\": true }`.\nIf you set `target` in your tsconfig.json to `es5`, set your `terserOptions` to `{ \"keep_fnames\": true }`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faigoncharov%2Fangular-builder-custom-terser-options","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faigoncharov%2Fangular-builder-custom-terser-options","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faigoncharov%2Fangular-builder-custom-terser-options/lists"}