-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
keenondrums
committed
Feb 20, 2019
1 parent
e5d0177
commit 7e917bf
Showing
19 changed files
with
10,904 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
*.log* | ||
/dist | ||
*.tgz | ||
/coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"hooks": { | ||
"pre-commit": "npx lint-staged" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"*.{js,ts,tsx,json,css,less,yml}": [ | ||
"npx prettier --write", | ||
"git add" | ||
], | ||
"*.md": [ | ||
"npx doctoc", | ||
"npx prettier --write", | ||
"git add" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
node_modules | ||
*.log* | ||
/src | ||
/docs | ||
/tsconfig* | ||
/tslint* | ||
/index.ts | ||
.prettierignore | ||
.vscode | ||
*.tgz | ||
*.md | ||
/coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"trailingComma": "all", | ||
"semi": false, | ||
"singleQuote": true, | ||
"arrowParens": "always", | ||
"printWidth": 120 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Andrey Goncharov | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,62 @@ | ||
angular-builder-custom-terser-options | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
**Table of Contents** _generated with [DocToc](https://github.com/thlorenz/doctoc)_ | ||
|
||
- [angular-builder-custom-terser-options](#angular-builder-custom-terser-options) | ||
- [Quick start](#quick-start) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
# angular-builder-custom-terser-options | ||
|
||
**PLEASE UPVOTE [THIS ISSUE](https://github.com/angular/angular-cli/issues/3861) TO BRING TERSER (UGLIFY) CUSTOMIZATION INTO ANGULAR'S DEFAULT BUILDER!!!** | ||
|
||
## Quick start | ||
|
||
1. Install | ||
|
||
``` | ||
npm i -D angular-builder-custom-terser-options | ||
``` | ||
|
||
1. Add builders from this package to your `angular.json`. | ||
|
||
1. Set `projects.yourProjectName.architect.build` to `angular-builder-custom-terser-options:browser-custom-terser` | ||
1. Set `projects.yourProjectName.architect.build.configurations.production.optimization` to `true` | ||
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). | ||
1. Set `projects.yourProjectName.architect.serve` to `angular-builder-custom-terser-options:dev-server-custom-terser` | ||
|
||
```json | ||
{ | ||
// ... 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 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"builders": { | ||
"browser-custom-terser": { | ||
"class": "./dist/src/browser", | ||
"schema": "./dist/src/browser/schema.json", | ||
"description": "Build a browser app with customized Terser options." | ||
}, | ||
"dev-server-custom-terser": { | ||
"class": "./dist/src/dev-server", | ||
"schema": "./dist/src/dev-server/schema.json", | ||
"description": "Dev server with customized Terser options." | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './src/browser' | ||
export * from './src/dev-server' |
Oops, something went wrong.