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

DanSmith's avatar

Setting include path for Sass in Elixir?

Hi all,

I usually use Zurb Foundation with Grunt but Elixir looks like a good excuse to move over to Gulp, however when I run Gulp with Foundation, I get errors as it can't locate the @import files.

With Grunt, I typically do something like this:

sass: {
      options: {
        includePaths: ['bower_components/foundation/scss']
      },

How can I specify this within Elixir?

Thanks

0 likes
6 replies
JeffreyWay's avatar
Level 59

We use the gulp-sass plugin. So you can use whatever options it (and Node Sass) accepts.

Here's the method definition...

mix.sass('path/to/src', 'path/to/output', {gulpSassOptions: 'here'});

So maybe try something like:

mix.sass("path", null, { includePaths: ['..'] });
2 likes
lee__mason's avatar

i too am having a few issues with this, im about half an hour away from using gulp-ruby-sass which i know pretty well, but hoping i can get a solution as would love to reduce repitition.

in my gulp file i have this:

.sass('bower_components/bootstrap-sass-official/assets/stylesheets/_bootstrap.scss', 'public/assets/css/bootstrap')

so im using bower bootstrap sass, and want to put the compiled version in "public/assets/css/bootstrap"

basically it doesnt work and no errors are thrown either which makes it difficult to debug.

any advice?

joselara's avatar

Same issue here. Anyone have a solution for this yet?

LichtAnd's avatar

Just in case anybody runs into the same issue like me. Maybe I can save you some time debugging. Looks like the options have been moved from the third to the fourth parameter:

Elixir.extend('sass', function (src, output, baseDir, options) {
  new _CssTask2.default('sass', getPaths(src, baseDir, output), options);
});

which results in a call like this:

mix.sass("path",  null,  null, { includePaths: ['..'] });
8 likes
ritey's avatar

Thanks @LichtAnd, helped saved me some time figuring why it stopped working!

WouterFlorijn's avatar

@JeffreyWay A bit late to the discussion, but do you have any idea why this is not in the documentation? It seems like pretty critical information in many projects. I don't think we should expect people to dive into the source code. If that was the case we wouldn't need documentation at all.

Please or to participate in this conversation.