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

fix: 修复sass/less-loader的路径解析 #1771

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

YufJi
Copy link
Contributor

@YufJi YufJi commented Feb 26, 2025

close #1767

sass-loader中配置importers, 完善sass文件中引用的路径解析

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests and other checks with just ready

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.03%. Comparing base (32d723d) to head (f66e1a8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1771      +/-   ##
==========================================
- Coverage   53.03%   53.03%   -0.01%     
==========================================
  Files         190      190              
  Lines       18960    18960              
==========================================
- Hits        10056    10055       -1     
- Misses       8904     8905       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.catch((err: any) => {
throw new Error(err.toString());
});
return { content: result.css, type: 'css' };
}

export { render };

function getResolver(compileStringAsync: any) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看上去是把 sass-loader 做的事又做了一遍,不知道有没有更好的解法,比如:

  1. 直接依赖 sass-loader 设法复用相关逻辑
  2. 搞个适配层直接用 sass-loader
  3. ……

cc @xusd320 @sorrycc @Jinbao1001

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@YufJi YufJi changed the title fix: 修复sass-loader的路径解析 fix: 修复sass/less-loader的路径解析 Feb 26, 2025
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.

Error: Can't find stylesheet to import. Mako build failed with sass used "@import '~xxx/variables.scss';"
3 participants