angular-cli-builders
A set of additional builders for angular-cli
Prerequsits:
- Angular CLI 6
- @angular-devkit/architect >= 0.7.0-rc.0
- @angular-devkit/build-angular >= 0.7.0-rc.0
- @angular-devkit/build-webpack >= 0.7.0-rc.0
Usage
npm i -D angular-cli-builders
- In your
angular.json
:
...
"architect": {
...
"[architect-target]": {
"builder": "angular-builders:[name-of-builder]"
"options": {
...
}
Where:
- [architect-target] is the name of build target you want to run (build, serve, test etc.)
- [name-of-builder] one of the supported builders (specified below)
ng [architect-target]
For example
Builders
custom-webpack-browser
Extended @angular-devkit/build-angular:browser
builder that allows to specify additional webpack configuration (on top of the existing under the hood).
The builder will run the same build as @angular-devkit/build-angular:browser
does with extra parameters that are specified in the provided webpack configuration.
Options:
- All the
@angular-devkit/build-angular:browser
options webpackConfigPath
: path to the extra webpack configuration, defaults to webpack.config.js
angular.json
Example:
"architect": {
...
"build": {
"builder": "angular-builders:custom-webpack-browser"
"options": {
"webpackConfigPath": "./extra-webpack.config.js",
"outputPath": "dist/my-cool-library",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json"
}
custom-webpack-server
Extended @angular-devkit/build-angular:server
builder that allows to specify additional webpack configuration (on top of the existing under the hood).
The builder will run the same build as @angular-devkit/build-angular:server
does with extra parameters that are specified in the provided webpack
configuration.
Options:
- All the
@angular-devkit/build-angular:server
options webpackConfigPath
: path to the extra webpack configuration, defaults to webpack.config.js
angular.json
Example:
"architect": {
...
"build": {
"builder": "angular-builders:custom-webpack-server"
"options": {
"webpackConfigPath": "./extra-webpack.config.js",
"outputPath": "dist/my-cool-library",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json"
}