assets entry for the build-angular does not support yarn pnp package paths?
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- angular, typescript
- 领域
- build-system
调研方向
首先使用提供的 ng new、yarn add、angular.json 中的 assets 条目和 yarn build 步骤重现问题,然后跟踪 build-angular 的 assets 处理及其包路径解析。完成的标准是:接受来自 Yarn Plug'n'Play 包的 assets 字典路径,并将其复制到配置的输出目录,而不会出现 project source-root 错误。
由索引模型根据 Issue 内容生成。
描述
Command
build
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
It does not appear to be possible to include assets and paths from a yarn pnp package.
It seems that build-angular builder supports pnp package resolution for styles, but not assets.
I would expect the assets path (dictionary specification option) to work to copy paths from pacakges in the pnp environment.
Minimal Reproduction
% ng new test-yarn-example --style scss --no-routing
% cd test-yarn-example
% yarn add ng2-pdfjs-viewer
Next, add the path to the angular.json.
Just adding the string will result in the error saying it must be in the project source root.
Adding the dictionary version, yields no error but does not copy the assets either.
{
"glob": "**/*",
"input": "node_modules/ng2-pdfjs-viewer/pdfjs",
"output": "/assets/pdfjs"
}
% yarn build
Exception or Error
Unable to copy assets: The ng2-pdfjs-viewer/node_modules/pdfjs asset path must start with the project source root.
Your Environment
Angular CLI: 16.0.2
Node: 18.15.0
Package Manager: yarn 3.5.0
OS: darwin arm64
Angular: 16.0.2
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1600.2 (cli-only)
@angular-devkit/build-angular 16.0.2
@angular-devkit/core 16.0.2 (cli-only)
@angular-devkit/schematics 16.0.2 (cli-only)
@schematics/angular 16.0.2 (cli-only)
rxjs 7.8.1
typescript 5.0.4
Anything else relevant?
No response
- 主要语言
- TypeScript
- 星标
- 27k
- 派生
- 11.8k
- 平均合并
- 17 小时 25 分钟
- 30 天内合并 PR
- 183
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
angular/angular-cli 的其他 Issue
-
area: @angular/build gemini-triaged
难度 2/5 1-3 小时 新手友好度 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
难度 2/5 1-3 小时 新手友好度 72/100
angular/angular-cli#33055 · 1 条评论 · 3 个 reaction ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 已指派 1 人 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 已指派 1 人 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34128 · 已指派 1 人 ·
查看 angular/angular-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
难度 2/5 1-3 小时 新手友好度 75/100
fil-donadoni/tolaria#4409 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
corsairdev/corsair#1764 ·