Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running gulp tasks with laravel elixir doesnt version all js files

I have this gulpfile.js https://gist.github.com/kristapsveveris/c25ba60984d8f3602d68

When I run gulp task, the result is :


(source: maxtraffic.com)

rev-manifest.json contains :

{
  "assets/js/all.js": "assets/js/all-d764f790.js",
  "assets/css/all.css": "assets/css/all-189848ae.css",
  "assets/css/serve-desktop.css": "assets/css/serve-desktop-037f21da.css",
  "assets/css/serve-mobile.css": "assets/css/serve-mobile-b0a650b6.css"
}

So the problem is that versioning doesn't create 'campaign.js' and 'serve.js' only their .map files

And if I run :

 gulp --production && gulp version --production

All versioning file are created

I'm running gulp tasks from windows

like image 278
Kristapsv Avatar asked Nov 01 '22 05:11

Kristapsv


1 Answers

What version of laravel-elixir are you using? This was a bug with elixir < v0.14.2

It looks like when concatenating a lot of files (or more likely, the output file is large), then it did not get versioned with the rest of the files.

It looks like you can run gulp version separately and they will get versioned. If you are experiencing this issue then gulp or gulp watch will not do it.

Here is my gulp file, vendor.js was being compiled but not versioned. It is not even the last file being versioned:

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

elixir(function(mix) {

    mix.sass('app.scss')

    .scripts([
        'react/react-with-addons.min.js',
        'jquery/dist/jquery.min.js',
        'bootstrap-sass-official/assets/javascripts/bootstrap.js'
    ], 'public/js/vendor.js', 'resources/assets/bower')

    .scripts(['app.js'], 'public/js/app.js', 'resources/assets/js')

    .version([
        'css/app.css',
        'js/vendor.js',
        'js/app.js'
    ]);

});

Running gulp version afterwards will version it.

It was fixed for me with laravel-elixir v0.14.2

like image 110
ryanwinchester Avatar answered Nov 09 '22 15:11

ryanwinchester