Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LESSからSCSSへの移行 #76

Merged
merged 37 commits into from
Oct 24, 2019
Merged

LESSからSCSSへの移行 #76

merged 37 commits into from
Oct 24, 2019

Conversation

sounisi5011
Copy link
Owner

resolve #56

@sounisi5011
Copy link
Owner Author

sounisi5011 commented Oct 18, 2019

@csstools/postcss-sassはimportしたファイルの検出にimporterオプションを使用している。

https://github.com/jonathantneal/postcss-sass/blob/71c47ccdf7e6a50304cd0c9a677e288886787706/index.js#L30-L56

けど、このimporterSASSがファイルを見つけられない場合にのみ呼び出されるものらしい。つまりは、SASSが自力で見つけられたファイルはPostCSSに依存関係として報告されないわけで、src/styles/_fontawesome/brands.scssみたいなファイルのfrontmatterは読み込めなくなってしまう。

その結果として、現状では、fontawesomeのフォントファイルを<link rel=preload>として設定できていない。

sass-loader別の方法でimportしたファイルを検出しているみたいだから、これは不可能な話ではなさそう。単純に@csstools/postcss-sassの実装の問題だな。

さて、ここからどうするか。マトモなSourceMapが生成されない問題も改善していないから、dart-sass用のMetalsmithプラグインを作る手もある。PostCSS用のdart-sass対応版を作るのもありだし…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LessからStylusに乗り換える
1 participant