Search code examples
laravelsassgulplaravel-elixir

Elixir only compiles to app.css


I'm using Laravel5 elixir to generate css files from my .scss files

this is my gulpfile.js

var elixir = require('laravel-elixir');
elixir.config.sourcemaps = false;

elixir(function(mix) {
    mix
        .sass(['homepage.scss'])
});

for some reason the output is always app.css instead of homepage.css any ideas? I updated elixir to "laravel-elixir": "^3.0.0"

what i'm missing?


Solution

  • reading documentation I saw that for "styles" we can have three arguments, one is an array that specifies the style files, second argument is the output file name and third argument is a resulting directory.

    Reading sass task source code we see that first argument is an array of files and the second argument is the output file.

    Adding a second argument to your code we have:

    var elixir = require('laravel-elixir');
    elixir.config.sourcemaps = false;
    
    elixir(function(mix) {
        mix
            .sass(['homepage.scss'], 'homepage.css')
    });