gpt4 book ai didi

sass - Webstorm 6 - 如何让 scss 文件观察器忽略文件

转载 作者:行者123 更新时间:2023-12-02 04:50:44 25 4
gpt4 key购买 nike

我希望 SCSS 文件的文件观察器忽略文件名以下划线开头的文件,例如 _buttons.scss。

我该怎么做?

最佳答案

首先向要忽略的文件添加一个 _...完成!来自documentation :

Partials

If you have a SCSS or Sass file that you want to import but don’t want to compile to a CSS file, you can add an underscore to the beginning of the filename. This will tell Sass not to compile it to a normal CSS file. You can then import these files without using the underscore.

For example, you might have _colors.scss. Then no _colors.css file would be created, and you can do

@import "colors";

所以添加下划线就可以了。只是不要导入。

小心命名你的文件,因为如果你有 style.scss_style.scss,Sass 会将它们视为相同的文件名并抛出错误:

>>> Change detected to: /Users/allcaps/test/style.scss
WARNING: In /Users/allcaps/test:
There are multiple files that match the name "style.scss":
_style.scss
style.scss

一个简单的解决方法是添加两个下划线:__style.scss

关于sass - Webstorm 6 - 如何让 scss 文件观察器忽略文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18905242/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com