Scss file watcher : specify loadPath somewhere ? Follow
Hello,
I'm using WebStorm with a file watcher for compiling SCSS files. It works peachy, except that before I was using the command line Ruby SCSS watch command which allowed to specify a list of loadPaths, so the @import calls could be cleaner and simpler.
In Webstorm, if I @import a file with such a URL, it gets highlited as not found (since I didn't fine any loadPaths config).
This leads to variables and functions not being picked up, code completion and jump to reference not working.
The only current workaround is to put relative paths in all @import clauses, which is very ugly, and involves a lot of "..\..\..\blah\file.scss" and so on.
Did I miss something or is there no way to configure one or two project-wide load paths for @import lookups ?
Thanks
Please sign in to leave a comment.
Hello!
no, it's not possible. See http://youtrack.jetbrains.com/issue/WEB-5855
Note that you can use Compass instead of SASS - Compass integration gets all your settings from config.rb file, so you can specify needed paths there
State wontfix, meaning you are not planning to make load paths work properly at all in the future ?
Well, with this issue plus the one with the generation of css files for partials, I must say that the scss file watcher thing and part of the support seems a bit unfinished ...
Ok now I have configured Compass with a config.rb file.
Works perfectly from the command line, however through WebStorm still issues ...
When I opened a scss file, it suggested me to add a "compass sass" file watch, which I did (I clicked the command link in the info window).
Now, when I edit the file, I see this in the output window :
Here is my config.rb
What should I do to make it compile properly please ?
Ok I made it work by changing the "Arguments" option value in the file watcher to :
which is the path where the main app.scss is located, and also the config.rb
The syntax inserted by WebStorms by default was actually calling compile on the specific file that was just modified, not what is wanted.
It all compiles fine now, but I still have issues with @imports.
Let's imagine I have a partial
now if in my main app.scss I do
it does compile, but WebStorm still displays an error in the source view with the hint "Can not resolve import", so I have no code completion or reference declaration jumps and so on, still.
I have configured the "Compass support" part in the settings though, with the proper path to my config.rb there (otherwise the compass file watched could not have compiled properly anyway).
How to get WebStorms to properly resolve the import please ?
hello support ?
Hello!
works fine for me. Can you attach a sample project that shows up the issue?
I opened another more speicfic and simplified question where I provided more details, thanks for the reply.