PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, February 1, 2022

[FIXED] Running gulp tasks with laravel elixir doesnt version all js files

 February 01, 2022     gulp, laravel, laravel-5, laravel-elixir     No comments   

Issue

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


Solution

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



Answered By - ryanwinchester
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing