Skip to content

Instantly share code, notes, and snippets.

@ratiw
Last active February 10, 2018 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ratiw/56546abf9c9d95577e44a5301c44d7c5 to your computer and use it in GitHub Desktop.
Save ratiw/56546abf9c9d95577e44a5301c44d7c5 to your computer and use it in GitHub Desktop.
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