webstrom自动编译scss

1.添加scss自动编译
在设置的File Watchers中添加Scss,然后只需为Program选择scss.bat(sass同理)

image.png

2.解决目录中文编译报错问题
目录中有中文,在写scss时 控制台会报如下错误:

image.png

解决方式:
找到C:\Ruby24-x64\lib\ruby\gems\2.4.0\gems\sass-3.5.1\lib\sass\importers\filesystem.rb
修改第87行if name.index(@root + "/") == 0为下图代码

84     # If a full uri is passed, this removes the root from it
85       # otherwise returns the name unchanged
86      def remove_root(name)
87       if name.encode("utf-8","gbk").index(@root + "/") == 0
88         name[(@root.length + 1)..-1]
89        else
90         name
91         end
92       end

参考知乎:https://www.zhihu.com/question/31111185

3.解决scss中文问题

开头写上@charest"UTF-8"

image.png

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容