laravel-elixir-rjs
v1.0.1
Published
Optimize your main file with Laravel Elixir
Downloads
3
Maintainers
Readme
Laravel Elixir requirejs optimization
Optimize your main requirejs file with Laravel Elixir.
Installation
First you need to install this package.
npm install --save-dev laravel-elixir-rjs
Then require this package into your gulpfile.js
.
var Elixir = require('laravel-elixir');
require('laravel-elixir-rjs');
Then call the rjs
method from your mix.
The rjs
method can take up to four arguments:
main
(optional): The main file to optimize (defaults tomain.js
).baseDir
(optional): The folder in which your js files are stored (defaults toresources/assets/js
).outputPath
(optional): The output folder (defaults topublic/js
).options
(optional): Options object passed to ther.js
command.
This task defines a watcher for the path defined in options.watchPath
.
Sample code:
Elixir(function(mix) {
mix.rjs('main.js', 'resources/assets/js', 'public/js', {
include: ['underscore', 'jquery', 'moment', 'requirejs'],
insertRequire: ['main'],
watchPath: ['app/**/*.js', 'main.js']
});
});