Search code examples
sassphpstorm

How do I change the SCSS output file location? phpstorm


I am new to phpStorm.I am trying to have the SCSS compiled file (css output) stored in the root, and not in the same folder as the scss file. I am confused as how to pass the arguments. I am trying to pass the arguments :css_location and :style. Can someone give me an example? I just have the default argument right now:

--no-cache --update $FileName$:$FileNameWithoutExtension$.css

UPDATE:

After much reading, I got to this:

--no-cache --update $FileName$:$FileDirPathFromParent$/$FileNameWithoutExtension$.css --trace

However, I am getting a permission denied error:

/usr/bin/scss sudo --no-cache --update style.scss:/style.css --trace
      error No such file or directory - sudo
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/plugin/compiler.rb:512:in `initialize': Permission denied - /style.css (Errno::EACCES)
    from /Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/plugin/compiler.rb:512:in `open'
    from /Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/plugin/compiler.rb:512:in `write_file'
    from /Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/plugin/compiler.rb:501:in `update_stylesheet'
    from /Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/plugin/compiler.rb:215:in `block in update_stylesheets'
    from /Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/plugin/compiler.rb:209:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/plugin/compiler.rb:209:in `update_stylesheets'
    from /Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/plugin.rb:82:in `update_stylesheets'
    from /Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/exec/sass_scss.rb:329:in `watch_or_update'
    from /Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/exec/sass_scss.rb:50:in `process_result'
    from /Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/exec/base.rb:40:in `parse'
    from /Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/exec/base.rb:19:in `parse!'
    from /Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/bin/scss:13:in `<top (required)>'
    from /usr/bin/scss:23:in `load'
    from /usr/bin/scss:23:in `<main>'

UPDATE:

Ok, I can't figure out these settings. I've attached a screen shot. All I am trying to accomplish is to get the style.css file to show up in the root instead of the css folder.

enter image description here


Solution

  • If 'root' is a project root, I'd suggest the following settings:

    Arguments: --no-cache --update $FileName$:$ProjectFileDir$/$FileNameWithoutExtension$.css
    Working dir: $FileDir$
    Output paths to refresh: $ProjectFileDir$/$FileNameWithoutExtension$.css
    

    Does it work for you?