webstrom自动编译scss

2017-08-03  本文已影响0人  NarCraven

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
上一篇下一篇

猜你喜欢

热点阅读