-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(@angular/cli): allow assets from outside of app root.
Fix #3555 Close #4691 BREAKING CHANGE: 'assets' as a string in angular-cli.json is no longer allowed, use an array instead.
- Loading branch information
1 parent
ca29eab
commit 9e91d86
Showing
8 changed files
with
276 additions
and
120 deletions.
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 |
---|---|---|
@@ -1,9 +1,39 @@ | ||
# Project assets | ||
|
||
You use the `assets` array in `angular-cli.json` to list files or folders you want to copy as-is when building your project: | ||
You use the `assets` array in `angular-cli.json` to list files or folders you want to copy as-is | ||
when building your project. | ||
|
||
By default, the `src/assets/` folder and `src/favicon.ico` are copied over. | ||
|
||
```json | ||
"assets": [ | ||
"assets", | ||
"favicon.ico" | ||
] | ||
``` | ||
``` | ||
|
||
You can also further configure assets to be copied by using objects as configuration. | ||
|
||
The array below does the same as the default one: | ||
|
||
```json | ||
"assets": [ | ||
{ "glob": "**/*", "input": "./assets/", "output": "./assets/" }, | ||
{ "glob": "favicon.ico", "input": "./", "output": "./" }, | ||
] | ||
``` | ||
|
||
`glob` is the a [node-glob](https://github.com/isaacs/node-glob) using `input` as base directory. | ||
`input` is relative to the project root (`src/` default), while `output` is | ||
relative to `outDir` (`dist` default). | ||
|
||
You can use this extended configuration to copy assets from outside your project. | ||
For instance, you can copy assets from a node package: | ||
|
||
```json | ||
"assets": [ | ||
{ "glob": "**/*", "input": "../node_modules/some-package/images", "output": "./some-package/" }, | ||
] | ||
``` | ||
|
||
The contents of `node_modules/some-package/images/` will be available in `dist/some-package/`. |
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
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
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
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
Oops, something went wrong.