webstrom自動(dòng)編譯scss

1.添加scss自動(dòng)編譯
在設(shè)置的File Watchers中添加Scss,然后只需為Program選擇scss.bat(sass同理)

image.png

2.解決目錄中文編譯報(bào)錯(cuò)問(wèn)題
目錄中有中文,在寫(xiě)scss時(shí) 控制臺(tái)會(huì)報(bào)如下錯(cuò)誤:

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中文問(wèn)題

開(kāi)頭寫(xiě)上@charest"UTF-8"

image.png

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容