Workspace library scss import
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- angular, scss, typescript
- 領域
- build-system, cli, frontend
調査の方向性
ワークスペースライブラリの build パスと generate パスから始め、再現ポイントとして生成された dist/my-company/my-lib/assets/_theme.scss、package.json の exports エントリ、projects/app/src/styles.scss を使用します。アプリの @use インポートを実行し、生成された tsconfig.json の設定を確認します。完了条件は、手動のパス指定や npm-link の回避策なしでエクスポートされた SCSS が解決されることです。
索引モデルが issue の本文から書いたものです。
説明
🚀 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.
- 主要言語
- TypeScript
- スター
- 27k
- フォーク
- 11.8k
- 平均マージ
- 16時間 35分
- マージ済み PR(30日)
- 176
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
angular/angular-cli のほかの issue
-
area: @angular/build gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
angular/angular-cli#33055 · コメント 1 件 · リアクション 3 件 ·
-
area: @angular/build gemini-triaged
難易度 4/5 3〜5日 初心者へのやさしさ 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 担当者 1 名 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 担当者 1 名 ·
angular/angular-cli の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vicharanashala/fln#563 ·