Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

assets entry for the build-angular does not support yarn pnp package paths?

オープン
#25,263 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
angular, typescript
領域
build-system

調査の方向性

まず、提供されている ng new、yarn add、angular.json の assets エントリ、yarn build の手順で問題を再現し、続いて build-angular のアセット処理とパッケージパスの解決を追跡します。Yarn Plug'n'Play パッケージの assets 辞書パスが受け付けられ、project source-root エラーなしで設定された出力先にコピーされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

area: @angular-devkit/build-angular
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分
マージ済み PR(30日)
183

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

angular/angular-cli のほかの issue

angular/angular-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。