Workspace library scss import
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- angular, scss, typescript
- Domínio
- build-system, cli, frontend
Direção de pesquisa
Comece pelos caminhos de build e generate de uma biblioteca de workspace, usando dist/my-company/my-lib/assets/_theme.scss, a entrada de exports de package.json e projects/app/src/styles.scss como pontos de reprodução. Execute a importação @use do app e inspecione as configurações do tsconfig.json gerado; considera-se concluído quando o SCSS exportado é resolvido sem soluções alternativas manuais de caminho ou npm-link.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
🚀 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.
- Linguagem predominante
- TypeScript
- Estrelas
- 27k
- Forks
- 11.8k
- Merge médio
- 17h 25min
- PRs com merge (30d)
- 183
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de angular/angular-cli
-
area: @angular/build gemini-triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
angular/angular-cli#33055 · 1 comentário · 3 reações ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 responsável ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 responsável ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34128 · 1 responsável ·
Todas as issues de angular/angular-cli
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
fil-donadoni/tolaria#4409 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
corsairdev/corsair#1764 ·