Search code examples
csssasspycharmjetbrains-idefile-watcher

SCSS compiler not working properly in PyCharm


I am trying to set up a SCSS transpiler in PyCharm for Django project.

Basically, what I need is to convert /static/scss/main.scss to /static/css/main.css

Here are the configurations of SCSS File Watcher:

Program: /home/maverick/.rvm/gems/ruby-2.2.3/bin/scss

Arguments: --no-cache --update /home/maverick/Documents/DjangoProjects/timberg/static/css/$FileNameWithoutExtension$.css

Working directory: /home/maverick/Documents/DjangoProjects/timberg/static/scss

Output paths to refresh: /home/maverick/Documents/DjangoProjects/timberg/static/css/$FileNameWithoutExtension$.css

What is happening is that main.css is being generated where it should. But it contains only errors, not the expected css, like this:

/*
Error: Inconsistent indentation: 2 spaces were used for indentation,    but the rest of the document was indented using 8 spaces.
    on line 39 of    /home/maverick/Documents/DjangoProjects/timberg/static/css/main.css

and etc.

What is wrong here? How can I fix it?


Solution

  • The problem was in the Arguments part.

    It should be:

    $FileName$:/home/maverick/Documents/DjangoProjects/timberg/static/css/$FileNameWithoutExtension$.css
    

    not just:

    /home/maverick/Documents/DjangoProjects/timberg/static/css/$FileNameWithoutExtension$.css
    

    My mistake was leaving out $FileName$: at the beginning.