Live sass 编译器不加载模块
我正在尝试在我的主样式文件中加载一个成员。
这是文件结构
这是 _body_style.scss 中的代码
body{
margin: 0px;
}
然后是 main_style 中的代码.scss
@use '_body_style';
这是 main_style.css 中的输出
@use '_body_style';
/*# sourceMappingURL=main_style.css.map */
编译器没有加载模块,我在控制台中没有看到任何错误
是否有我缺少的配置或者我做错了?我之前在另一个项目中使用过它,但我不记得有这样的问题。
I'm trying to load a member in my main style file.
Here is the file structure
Here is the code from _body_style.scss
body{
margin: 0px;
}
Then code code from main_style.scss
@use '_body_style';
And this is the output in main_style.css
@use '_body_style';
/*# sourceMappingURL=main_style.css.map */
The compiler is not loading the module and I don't see any errors in console
Is there any configuration I'm missing or am I doing it wrong? I used this before for a different project and I don't remember having such problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 Glenn Marks 的 Live Sass 编译器
问题是由您用于将 SASS 或 SCSS 文件编译为 CSS 文件的 Visual Studio Code 扩展引起的。
不要使用此扩展:Live Sass 编译器Ritwick Dey
您可能正在使用 此扩展:Ritwick Dey 的 Live Sass 编译器。它被广泛使用,但作者不再支持。因此,SASS 版本不会更新。此扩展会产生您所描述的错误。
使用此扩展:Live Sass Compiler by Glenn Marks
您应该使用这个扩展:Glenn Marks 的 Live Sass 编译器。正如作者所说:非常感谢 @ritwickdey 所做的所有工作。然而,由于他们不再维护原始作品,我发布了自己的作品。此扩展可以成功地将您的 SASS 或 SCSS 文件编译为 CSS 文件。
Use Live Sass Compiler by Glenn Marks
Well, the problem is caused by the Visual Studio Code extension you are using for compiling SASS or SCSS files to CSS files.
Don't use this extension: Live Sass Compiler by Ritwick Dey
You are probably using this extension: Live Sass Compiler by Ritwick Dey. It's widely used, but is no longer supported by the author. Consequently, the SASS version isn't updated. This extension produces the error you are describing.
Use this extension: Live Sass Compiler by Glenn Marks
You should use this extension: Live Sass Compiler by Glenn Marks. As the author states: A big thank you to @ritwickdey for all his work. However, as they are no longer maintaining the original work, I have released my own which has been built upon it. This extension compiles your SASS or SCSS files to CSS files successfully.