Flatten glob "assets" to one output folder
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- angular, typescript
- Domain
- build-system, cli
Research direction
Start with the asset export configuration and compare how ng serve, ng build --watch, and a regular build process the shown glob. The change is done when nested assets can be emitted directly under dist/assets without the intermediate module and assets folders, while remaining available to the in-memory serve workflow.
Written by the indexing model from the issue text.
Description
π Feature request
- [ ] new
- [x] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Description
I am currently working with nested assets folder per entity map. Currently, I am using the following assets export settings:
{
"glob": "**/assets/**/*",
"input": "src/app",
"output": "/assets",
"ignore": ["**/*.ts"]
}
Imagine having the following file structure:
src
βββ app
| βββ module-folder
| | βββ assets
| | β βββ images
| | β β βββ image1.png
| βββother-module-folder
| | βββ assets
| | β βββ images
| | β β βββ image2.png
What I get
This would result in the following dist/ file structure:
dir
βββ assets
| βββ module-folder
| | βββ assets
| | β βββ images
| | β β βββ image1.png
| βββother-module-folder
| | βββ assets
| | β βββ images
| | β β βββ image2.png
What I want to have
dir
βββ assets
| βββ image1.png
| βββ image2.png
What I have tried
I have tried to use a custom script to move the assets files manually in a flatten way to the dir folder.
for file in ./src/app/**/assets/**/*.*; do cp "$file" "./dist/assets/$(basename -- "$file")" ;done
This, however, does not work in combination with ng serve as the files are in-memory, and also does not work with the ng build --watch as I am unsure how to activate script after it has been built.
I would love to get some insight into the best approach. Maybe this is simply using an already existing flow. From my point of view, this should be included as functionality, as the nested folder structure strategy seems to be one of the more common approaches.
- Dominant language
- TypeScript
- Stars
- 27k
- Forks
- 11.8k
- Avg merge
- 16h 35m
- Merged PRs (30d)
- 176
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up β it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from angular/angular-cli
-
area: @angular/build gemini-triaged
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
angular/angular-cli#33955 Β·
-
area: @angular/cli gemini-triaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
angular/angular-cli#33055 Β· 1 comment Β· 3 reactions Β·
-
area: @angular/build gemini-triaged
Difficulty 4/5 3-5 days Newbie friendliness 72/100
angular/angular-cli#34137 Β·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 Β· 1 assignee Β·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 Β· 1 assignee Β·
All issues in angular/angular-cli
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dennys-bd/agent-hive#184 Β·
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 Β·
-
ai-observability bug team/ai-observability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
databricks/databricks-sql-nodejs#526 Β·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vicharanashala/fln#563 Β·