I can't figure out how to set a macro mask to get the desired result. In the project there is a SCSS category with its own tree, and there is exactly such a CSS folder with the same directory structure. How do I rebuild the compilation option in the right folder. The problem is that being in the root of the SCSS is easy to fall into the root of CSS. But here are the folders that are invested deeper, or how not to arrange them correctly. The fact is that the CSS and SCSS folders are not at the root of the project. They themselves are laid in depth. That is, here is the path: M: / themes / theme01 / scss and, accordingly, M: / themes / theme01 / css. The fact that I edit the SCSS is normal to go to the CSS. But there is also a deeper folder. For example, when I edit the SCSS file, which is located at M: /themes/theme01/scss/modules/mododule12/css/style.scss, it is not compiled into M: / themes / theme01 / css / modules / mododule12 / css /style.css. It appears in the same folder as SCSS itself. Among the macros, in the settings of the "observer" I did not find the necessary variable. In fact, I need to somehow indicate my own root, from where the tree of CSS folders and SCSS will grow (ie, M: / themes / theme01 /). Through macros there is nothing like that. Help, is there any solution?
- It was a case, I wanted to set up a similar compilation from LESS to CSS, but I ran into exactly the same problems. As a result, I switched to using gulp, which provides more opportunities. It has a gulp.watch method, thanks to which you can run a task in track mode for file changes. - Konstantin Basharkevich
|
1 answer
You can try using $FileDirPathFromParent$ . Let's say if the M:/themes/theme01 corresponds to the project root, the settings might look like this:
Arguments: --no-cache --update $FileName$:$ProjectFileDir$/css/$FileDirPathFromParent(scss)$/$FileNameWithoutExtension$.css Working directory: $FileDir$ Output paths to refresh: $ProjectFileDir$/css/$FileDirPathFromParent(scss)$/$FileNameWithoutExtension$.css:$ProjectFileDir$/css/$FileDirPathFromParent(scss)$/$FileNameWithoutExtension$.css.map |