/laravel-elixir-wiredep

This Laravel Elixir extension allows you using wiredep.

Primary LanguageJavaScript

#Laravel-Elixir-Wiredep

This Laravel Elixir extension allows you using wiredep.

Getting Started

First, install the module through npm:

$ npm install --save @killtw/laravel-elixir-wiredep

Next, add some config to your gulpfile.

var elixir = require('laravel-elixir');
require('@killtw/laravel-elixir-wiredep');

elixir(function(mix) {
   mix..wiredep();
});

Then install your dependencies:

$ bower install jquery --save

Inset placeholders in your files:

<html>
  <head>
    <!-- bower:css -->
    <!-- endbower -->
  </head>
  <body>
    <!-- bower:js -->
    <!-- endbower -->
  </body>
</html>

That's it! You're all set to go!
This will scan your Bower dependencies on bower.json and inject them in your files.

Note

Wiredep will import your dependencies directly, so make sure your bower dependencies will install in public folder.
Just create a .bowerrc file in the root of your project, like:

{
  "directory" : "public/bower_components"
}

Options

mix.wiredep({
    baseDir: 'resources/',
    src: ['**/*.php', '/**/*.+(sass|scss)', '**/*.less']
}, options);

*Note: options accepts all wiredep options.

  • baseDir - the folder for your files
  • src - files for search