Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using Bower with Laravel 5.2 and Laravel Elixir
  • Install bower by following instruction at bower.io
  • Make bower knows where should it keeps downloaded/installed packages
    • Create .bowerrc at the root of project directory with the following content:
    {
      "directory": "vendor/bower_components"
    }

This will tell bower to use vendor/bower_components as its default directory

  • Put .bowerrc in .gitignore file
  • Update gulpfile.js
elixir(function(mix) {
  mix.scripts([
    .. list of scripts to combine ..
  ], '<outfile filepath>', '<base dir to look for those files in the list>');
  
  mix.styles([
    .. list of styles to combine ..
  ], '<outfile filepath>', '<base dir to look for those files in the list>');

  mix.copy('<from dir or file>', '<to dir or file>');
});

** If use `mix.version()` the output file will be placed in side `public/build` directory **
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment