assets entry for the build-angular does not support yarn pnp package paths?
- Lenguaje dominante
- TypeScript
- Estrellas
- 27k
- Forks
- 11.8k
- Merge medio
- 14 h 23 min
- PR fusionados (30 d)
- 162
Descripción
### 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
```text
Unable to copy assets: The ng2-pdfjs-viewer/node_modules/pdfjs asset path must start with the project source root.
```
### Your Environment
```text
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_
Guía de contribución
Línea de trabajo
Comienza reproduciendo el problema con los pasos proporcionados de ng new, yarn add, la entrada de assets en angular.json y yarn build; después, sigue el manejo de assets de build-angular y la resolución de sus rutas de paquetes. Se considera terminado cuando se acepta una ruta de diccionario de assets de un paquete Yarn Plug'n'Play y se copia en la salida configurada sin el error de project source-root.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- angular, typescript
- Área
- build-system
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 48/100