Skip to content

Commit

Permalink
fix: mako已经支持了scss 但是没有支持module.scss文件 (#1770)
Browse files Browse the repository at this point in the history
Co-authored-by: shikuan.sk <shikuan.sk@antgroup.com>
  • Loading branch information
notcold and shikuan.sk authored Feb 18, 2025
1 parent b754992 commit 481e74a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/mako/src/visitors/virtual_css_modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ pub struct VirtualCSSModules {
}

fn is_css_modules_path(path: &str) -> bool {
path.ends_with(".module.css") || path.ends_with(".module.less")
path.ends_with(".module.css")
|| path.ends_with(".module.less")
|| path.ends_with(".module.scss")
}

pub fn is_css_path(path: &str) -> bool {
Expand Down
2 changes: 2 additions & 0 deletions examples/rsc/src/c.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.c { color: blue; }

1 change: 1 addition & 0 deletions examples/rsc/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import Foo from './Foo';
import './a.less';
import './b.module.less';
import './c.module.scss';

export default function App() {
return (
Expand Down

0 comments on commit 481e74a

Please sign in to comment.