Live sass 编译器不加载模块

发布于 2025-01-20 22:22:35 字数 571 浏览 2 评论 0原文

我正在尝试在我的主样式文件中加载一个成员。

这是文件结构

文件结构

这是 _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

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

Console output

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浮华 2025-01-27 22:22:35

使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文