1.0.1 • Published 9 years ago
laravel-elixir-js-uglify v1.0.1
Laravel Elixir Uglify
This package allows you to uglify your javascript files. This is useful when you are loading scripts asynchronously.
Installation
First you need to install this package.
npm install --save-dev laravel-elixir-js-uglify
Then require this package into your gulpfile.js
.
var Elixir = require('laravel-elixir');
require('laravel-elixir-js-uglify');
Then call the uglify
method from your mix.
The uglify
method can take up to four arguments:
src
(required): The files to uglify.outputPath
(optional): The output folder (defaults topublic/js
).baseDir
(optional): The folder in which your js files are stored (defaults toresources/assets/js
).options
(optional): Options object passed to thegulp-uglify
task.
This task defines a watcher for the path defined in src
.
Sample code:
Elixir(function(mix) {
mix.uglify('**/*.js', 'public/js', 'resources/assets/js');
});