angular / angular/angular-cli

Junctions (linked folders) in the assets folder are only partially copied to the build output

未關閉
#19,086 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area: @angular-devkit/build-angular devkit/build-angular:browser feature feature: insufficient votes
主要語言
TypeScript
星號
27k
分支
11.8k
平均合併
14 小時 23 分鐘
30 天內合併 PR
162

描述

# 🐞 Bug report

### Command

- [ ] new
- [x] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

### Is this a regression?
Did not work with ng 8 and does not work with ng 10. Did not check with 9 or anything before 8.

### Description

When creating a junction inside the src/assets folder to another folder somewhere in the filesystem, the compiled output only contains the files that are directly beneath the linked folder. Any sub-folders in this linked folder are ignored by the compiler.

## 🔬 Minimal Reproduction
Tested on Windows 10:

1. Create an empty angular app with `ng new assetsBugApp`,
2. create a folder outside the application like "testAssets"
3. Inside "testAssets" create a textfile "works.txt"
4. Inside "testAssets" create a folder "myFolder"
5. Inside "testAssets/myFolder" create a textfile "does not work.txt"
6. Create a junction from "assetsBugApp/src/assets/test" to "testAssets" (eg `mklink /J C:\tmp\assetsBugApp\src\assets\test C:\tmp\testAssets`)
7. Run `ng build`
8. Look in the dist/assets folder. You will find the folder "test" containing "works.txt" but no "myFolder" and no "does not work.txt"

## 🌍 Your Environment



Angular CLI: 10.1.4
Node: 12.18.3
OS: win32 x64

Angular: 10.1.4
... animations, cli, common, compiler, compiler-cli, core
... elements, forms, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package Version
------------------------------------------------------------
@angular-devkit/architect 0.1001.4
@angular-devkit/build-angular 0.1001.4
@angular-devkit/build-ng-packagr 0.1001.4
@angular-devkit/core 10.1.1
@angular-devkit/schematics 10.1.4
@angular/cdk 10.2.3
@angular/language-service 10.1.1
@angular/material 10.2.3
@schematics/angular 10.1.4
@schematics/update 0.1001.4
ng-packagr 10.1.2
rxjs 6.6.3
typescript 3.9.7

**Anything else relevant?**
Might be isolated to Windows environments.

Would be great to have this resolved, copying assets from A to B is less fun than linking them... :)

貢獻指南

開啟貢獻指南

研究方向

首先,在 src/assets 下使用 junction 重現 Windows 10 的情況,然後將 build 和 serve 對連結資料夾的處理與 dist/assets 的輸出進行比較。當 myFolder/does not work.txt 之類的巢狀資料夾和檔案都能被複製,而不只是 junction 直接下的檔案時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
angular, typescript
領域
build-system, cli
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。