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

angeloa's avatar

Gulpfile Elixir merge scss (includePaths?)

I've tried a thousand different things, but I just can't get this to work. It seems the tutorials on the Front-End series are old, because some functions changed. Anyways, I currently have this:

var elixir = require('laravel-elixir');


var paths = {
    'jquery': './vendor/bower_components/jquery/',
    'bootstrap': './vendor/bower_components/bootstrap-sass-official/assets/',
    'fontawesome': './vendor/bower_components/fontawesome/',
    'bootstraptwo': './resources/assets/vendor/bower_components/bootstrap-sass/assets/'
}

elixir(function(mix) {
    mix.sass('main2.scss', 'public/css/', {includePaths: [
            paths.bootstraptwo + 'stylesheets',
            paths.fontawesome + 'scss'
        ]})
        .copy(paths.bootstraptwo + 'fonts/bootstrap/**', 'public/fonts/bootstrap')
        .version([
            //'css/main.css',
        ])
});

the .sass functions doesn't include the bootstrap and fontawesome paths as it should (right?). I know the bootstraptwo path works because the files in the .copy function actually get copied. I just have no clue why elixir doesn't add the bootstrap stylesheets to my .css file. The only thing I see in my .css file, are the things I wrote in main2.scss.

(I've searched, A LOT, but nothing seems to fix my problem)

0 likes
3 replies
alexey.m.ukolov's avatar
Level 9

Hi. This works for me:

var elixir = require('laravel-elixir');

var paths = {
    'bootstrap': '/bower_components/bootstrap-sass/assets/',
}

elixir(function (mix) {
    mix.sass('app.scss', 'public/css', {
        includePaths: [
            __dirname + paths.bootstrap + 'stylesheets/'
        ]
    });

    mix.version("css/app.css");
});

Note that I have bower_conponents in a root directory.

1 like
Zalo's avatar

That didn´t work for me.. I had to add includePaths option as 4º argument

mix.sass('app.scss', null, null, {includePaths: ['node_modules/bootstrap-sass/assets/stylesheets']})

Please or to participate in this conversation.