l00k
l00k

Reputation: 1545

PhpStorm SCSS trigger compilation on partial change

First of all I have to note that this all worked well some time ago. I have returned to project after some time. Meanwhile I have updated PhpStorm and migrated to Win10. Everything else stayed untouched.

I have problem with triggering scss parial compilation. When I make changes in root file "global.scss" everything works ok - partials are also compiled. However when I make changes in partials PhpStorm not triggers compilation of root file.

PhpStorm version: 2017.2.3

File structure:

file structure

Watcher config: watcher config

Scope config:

scope config

global.scss

global.scss

I have tried a lot - nothing works. It seems that partials - prefixed with underscore are just ignored by file watcher.

EDIT: I found something - it seems that wildcard in scope pattern ignores underscored files. However partials are marked as included in files tree. I temporarly changed scope to project files and it works well - unfortunetally I can not leave this setting.

EDIT2: I don't know is it bug or feature but PhpStorm handles nested Source roots in strange way. Check this file structure:

file structure

Without source root for scss directory, compilation is triggered even with scope pattern. However compiled css is placed in wrong directory - so it is not usable.

Upvotes: 1

Views: 508

Answers (1)

LazyOne
LazyOne

Reputation: 165148

Based on your info and investigation: you are using nested "Source" folder (on scss) and $SourcepathEntry$ & related macro... which does not seem to work as you expected in your IDE version.

Get rid of it -- your setup does not need it at all. Your folder structure is pretty standard so it can be resolved using more "standard" ways.

  • Disable this File Watcher for now (you may delete it later) and make new one.
  • There try $FileDirPathFromParent()$ parametrized macro (it accepts parameters). For example for $FileDirPathFromParent(src)$ it returns foo/bar for some/path/src/foo/bar/baz.scss file path. This macro should do the job when making the needed path.

Upvotes: 1

Related Questions