Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug Laravel5 Elixir gulpfile.js?

Tags:

gulp

laravel

I'm having the following 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 Less
 | file for our application, as well as publishing vendor resources.
 |
 */

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

elixir(function (mix) {
    mix.sass('app.scss', 'public/css/')
        .copy(paths.bootstrap + 'fonts/bootstrap/**', 'public/fonts')
        .scripts(
        [
            paths.jquery + "dist/jquery.js",
            paths.bootstrap + "javascripts/bootstrap.js",
            paths.js + "app.js"
        ],
        'public/js/app.js', './')
        .version(['js/app.js', 'css/app.css']);
    mix.copy('public/js/app.js.map', 'public/build/js/app.js.map');
    mix.copy('public/css/app.css.map', 'public/build/css/app.css.map');
});

However, the .map-files are not copied to the public/build/ folder. Am I doing something wrong with mix.copy()? How can I see why the files are not copied?

I actually think this is a bug in Laravel Elixir as well, since mix.version() should already copy the .map files already without the need for manual copying.

UPDATE

I filed a issue on Github: github.com/laravel/framework/issues/7650

like image 276
tholu Avatar asked Feb 27 '15 14:02

tholu


1 Answers

As @Thomas said, it's fixed now: https://github.com/laravel/elixir/commit/77464c615b0fd2640eedd2954cd9c8cb3dfc6f44

Commit message:

When versioning files, copy over .map files as well.

like image 63
rap-2-h Avatar answered Oct 16 '22 13:10

rap-2-h