Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dhristov's avatar

Can Elixir mix only the changed SASS files?

Lets say I want my Bootstrap or Foundation css to be a separate file along with my app.css.

If I make a mix for them and another for my app.scss, I get both my app.scss and the framework scss compiled every time I make a change to the app.scss.

This would be OK if it didn't take 5-8 seconds every time to recompile the framework scss.

Here is a simple code of what I have in mind:

elixir(function(mix) {

     var    bowerPath   = "../../../resources/assets/bower_components/",
            publicPath  = "public/";

    mix.sass('app.scss')
          .sass(
        bowerPath + 'foundation/scss/foundation.scss',
        publicPath + 'css/foundation.css'
        );
});

Is there any way to tell Elixir to compile only the changed files and not everything.

0 likes
2 replies
bobbybouwmann's avatar

Well, think about it. How can it only compile the changes? Let's say your custom sass file has 200 lines and you add another 20. Now they have to be added. But where do you add them? Do you need to remove some sass as well? When you mix all styles it makes one file. That one file needs to be updated everytime. You can't just say update these 20 lines as far as I know!

The best way of doing it would be not saving it all the time, or wait a few seconds ;)

dhristov's avatar

You got me wrong :)

I dont mind compiling my whole app.scss on every change, I dont want it to compile my frameworks like Bootstrap every time I write something in my app.scss when the two files are completely separate and the compiled files stay separate.

Please or to participate in this conversation.