Set up Elixir with Laravel 5

First, make sure you have gulp installed.

npm install --global gulp

Then run npm install in order to install Elixir.

Next, install the dependencies you want via bower. I will be installing jquery and bootstrap. “cd” into your “resources” directory and run

bower install jquery
bower install bootstrap

You should now have a “bower_components” folder within your “resources” directory. Open up “gulpfile.js” located at your project’s root level. Edit that file to look like this:

elixir(function(mix) {



For reference, if you want to add your own scripts and also combine your css files, do something like this:

elixir(function(mix) {
    // compile less into css (will put them in public/css by default)

    // combine all scripts in the order listed (into /js/all.js by default)

    // combine all styles in the order listed into /css/all.css
    ], 'public/css/all.css', 'public/css');

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.