美文网首页
webstrom自动编译scss

webstrom自动编译scss

作者: NarCraven | 来源:发表于2017-08-03 17:40 被阅读0次

    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

    相关文章

      网友评论

          本文标题:webstrom自动编译scss

          本文链接:https://www.haomeiwen.com/subject/ylgplxtx.html