Webstorm SCSS File Watcher does not respect parent directory

匿名 (未验证) 提交于 2019-12-03 01:20:02

问题:

My scss has the following structure:

Nested directory view:

style   sass     components       _somecomponent.scss       _someothercomponent.scss     style.scss   style.css 

Collapsed directory view:

style/style.css style/sass/style.scss style/sass/components/_somecomponent.scss style/sass/components/_someothercomponent.scss 

style.scss includes _somecomponent.scss and _someothercomponent.scss, and is supposed to generate style.css. It does all of this correctly, but the output file is not in the correct directory. Currently it outputs to style/sass/style.css.

Webstorm is configured with the following parameters:

Program: /usr/bin/sass Arguments: --no-cache --update $FileName$:$FileNameWithoutExtension$.css Working directory: $FileDir$ Output path: $FileParentDir$\$FileNameWithoutExtension$.css 

The phpstorm tag has been added because it shares the same file watcher with webstorm. I am using Mac OS X, with the latest Webstorm 9.x.

How do I fix the output path?

回答1:

Please change the Arguments field accordingly:

    Program: /usr/bin/sass     Arguments: --no-cache --update $FileName$:$FileParentDir$/$FileNameWithoutExtension$.css     Working directory: $FileDir$     Output path: $FileParentDir$/$FileNameWithoutExtension$.css 

The 'Output paths to refresh' option doesn't tell the compiler where to put the generated files - you have to set the program arguments accordingly; 'Output paths' is used by IDE to synchronize its file system with external changes - you need to make sure that the pattern specified there matches the actual compiler output so that the IDE knows where to look for generated files. So you need to modify BOTH 'Arguments' and 'Output path to refresh' options to have the generated files created in non-default location.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!