Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen
#25,263 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
angular, typescript
Bereich
build-system

Rechercherichtung

Beginne damit, das Problem mit den bereitgestellten Schritten ng new, yarn add, dem Asset-Eintrag in angular.json und yarn build zu reproduzieren, und verfolge anschließend die Asset-Verarbeitung von build-angular und deren Auflösung von Paketpfaden. Erledigt ist die Aufgabe, wenn ein Assets-Dictionary-Pfad aus einem Yarn Plug'n'Play-Paket akzeptiert und ohne den Fehler zum Projekt-Source-Root in das konfigurierte Ausgabeverzeichnis kopiert wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
TypeScript
Sterne
27k
Forks
11.8k
Ø Merge
17 Std. 25 Min.
Gemergte PRs (30 T.)
183

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus angular/angular-cli

Alle Issues in angular/angular-cli

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.