mardi 11 octobre 2016

Using gulp/elixir to mix, minify & version css & stylesheet result in $ is not defined error

I have been using laravel for a while and I have been meaning to learn how the asset management works in laravel - so I gave it a go today and having some trouble already.

All my "css" are placed in public/css/ and "javascripts" in public/js/ dir, which looks likes this:

enter image description here

using the gulpfile.js - I've configured my elixir mixes like this:

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

elixir(function(mix) {

    // Mix all css files
    mix.stylesIn('public/css');

    // Mix all the javascript files
    mix.scriptsIn('public/js');

    // Version combined & minified assets
    mix.version([
        'public/css/all.css',
        'public/js/all.js'
    ]);

});

I then ran this command: gulp --production

Which gave the following output:

enter image description here

Then I updated my footer.blade.php (which previously were pointing to individual js files) with the following:

enter image description here

When I refreshed the site, the page is broken and I am getting this error in javascript console: $ is not defined error

enter image description here

Any idea why this isn't working? Am I doing something wrong?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire