How to configure Koala Sass auto compile on partials changes?
Asked Answered
R

2

5

I'm using Koala for Win64 to compile sass (with lot of partials) to css with no problems, but Koala auto compile function is only runs when there are updates in root scss file, so I need to open Koala and press 'compile' button every time when I made changes to included partials.

Is there any way to configure scss auto compile to watch for changes in sass partials?

Rubidium answered 9/8, 2014 at 7:16 Comment(1)
I'm using Koala and it compiles on partials by default, no problems whatsoever.Docent
W
8

So came across this as I was having problems myself. Just documenting...

1st thing I did

was to create a style.scss or global.scss (making sure to setup "Auto Compile" in Koala) and only fill it with imports:

@import 'layout'; //_layout.scss
@import 'layout_modules'; // _layout_modules.scss
@import 'modules'; // _modules.scss
@import 'theme'; // _theme.scss

When I would work on the partials (partials will have a _ in front of the filename) and save I would get an autocompile confirmation (Koala Settings > General > "Notification when compile is completed")

But _layout_modules.scss would not trigger autocompile on save. If I switched over to another partial and saved, it would autocompile and Koala would still throw helpful errors for _layout_modules.scss.

2nd thing I did

then, was to remove the extra underscore in the filename - so it would just be _layoutmodules.scss (make sure to update your @import on style.scss) and worked as expected.

(I've been using Sass for all of 5 days.)

Walford answered 10/2, 2015 at 15:48 Comment(1)
I'm not sure if Koala still does this, but I use Compass now on a Mac and it doesn't care if I use multiple underscores to name my partials. Also, PRO TIP: look up "Sass Globbing", will save you tons of time writing imports.Walford
Z
1

Short answer: add _ before partial files and import them to the main file.

Thanks to @philtune

Zingale answered 21/8, 2016 at 6:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.