Search code examples
laravel-5gulplaravel-elixir

laravel 5 how to compile elixir with template inside node_modules


I have installed https://github.com/puikinsh/gentelella on my application, is there a way to link the assets to laravel elixir?

here is my template directory

Root
|-app/
|-node_module/
|   |-gentelella/ # -> this is my template
|-gulpfile.js
|-public/
// other laravel folders to follow.

Inside ./gulpfile.js

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

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(function(mix) {
    mix.sass('app.scss');
});

Solution

  • Try this:

    elixir(function(mix) {
        mix.sass('app.scss');
    
        mix.styles([
            'node_modules/path/to/gentelella/css.css'
        ], 'public/css/app.css', './');
    
        mix.version('public/css/app.css');
    });