Workspace library scss import
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- angular, scss, typescript
- Área
- build-system, cli, frontend
Línea de trabajo
Comienza con las rutas de build y generate de una biblioteca de workspace, usando dist/my-company/my-lib/assets/_theme.scss, la entrada de exports de package.json y projects/app/src/styles.scss como puntos de reproducción. Ejecuta la importación @use de la aplicación e inspecciona la configuración del tsconfig.json generado; se considera terminado cuando el SCSS exportado se resuelve sin soluciones alternativas manuales de rutas o npm-link.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
🚀 Feature request
Command (mark with an x)
- new
- build
- serve
- test
- e2e
- generate
- add
- update
- lint
- extract-i18n
- run
- config
- help
- version
- doc
Description
With a workspace architecture, the exported stylesheets cannot be imported using package name. Given a library (lib) and a project (app) in an angular workspace. The library properly copies an scss file to the dist folder (which is the default output folder) and adds it to the exports section of the package.json. However, the consuming app cannot @import or @use the exported scss file.
Given the following files:
- dist/my-company/my-lib/assets/_theme.scss
- projects/app/src/styles.scss
And the following export in the package.json of the library:
"exports": {
"./theme": {
"sass": "./assets/_theme.scss"
}
},
And the default settings that the Angular CLI generates (with ng new library and so on...),
Describe the solution you'd like
With the settings mentioned above, importing an exported scss file should work out of the box (currently it does not compile with the error SassError: Can't find stylesheet to import.).
// styles.scss
@use "@my-company/my-lib/theme" as myTheme;
Describe alternatives you've considered
- Changing the default
distoutput of the library to thenode_modulesand the automatically removed@symbol is added to the path (in shortdist/my-company/my-lib->node_modules/@my-company/my-lib) resolves the scss import problem. Thetsconfig.jsonmust be adjusted as well. If this is the desired solution, then it should be the default generated with the CLI. - Create an NPM Link to the dist directory (which has its own pros and cons). If this is the desired solution, then the
tsconfig.jsondoes not need to define additionalpathsand this should be an operation that the generation (through the CLI) does automatically. Or at least extend the documentation.
- Lenguaje dominante
- TypeScript
- Estrellas
- 27k
- Forks
- 11.8k
- Merge medio
- 17 h 25 min
- PR fusionados (30 d)
- 183
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de angular/angular-cli
-
Can't use an array of hostnames in --allowedHosts cli parameter in @angular/build:dev-server Abiertoarea: @angular/build gemini-triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
angular/angular-cli#33055 · 1 comentario · 3 reacciones ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 asignado ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 asignado ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34128 · 1 asignado ·
Todos los issues de angular/angular-cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
bug v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
modelcontextprotocol/inspector#2458 · 1 comentario ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
carbon-design-system/ibm-products#9907 ·