Highly customizable browserify extension for laravel elixir. Includes support for transforms, watchify and multiple bundles.
Work to this package was abadonded. No further updates will be perfomed. Consider use the official package. Thanks for all contributors for their support.
npm install --save-dev laravel-elixir-browserify
var elixir = require('laravel-elixir');
var browserify = require('laravel-elixir-browserify');
elixir(function(mix) {
// make sure this line is inside of elixir callback function
// to replace default browserify task
browserify.init();
mix.browserify("bootstrap.js");
});
First argument is the entry point of your application (default directory is resources/assets/js). In second argument you could pass plugin options and browserify options.
var elixir = require('laravel-elixir');
var browserify = require('laravel-elixir-browserify');
elixir(function(mix) {
browserify.init();
mix.browserify("bootstrap.js", {
debug: true,
insertGlobals: true,
transform: ["debowerify"],
output: "public/js",
rename: "bundle.js"
});
});
If you want to use watchify for browserify just run gulp watchify
instead of standard gulp watch
command. Elixir's watch task is a dependency of watchify and will also be run.
var elixir = require('laravel-elixir');
var browserify = require('laravel-elixir-browserify');
elixir(function(mix) {
browserify.init();
mix.browserify("bootstrap.js");
});
var elixir = require('laravel-elixir');
var browserify = require('laravel-elixir-browserify');
elixir(function(mix) {
browserify.init();
mix.browserify("admin.js")
.browserify("app.js", { transform: ["reactify"] })
});
Laravel Elixir has own browserify task, but this plugin replaced him. If you want to use both tasks or maybe you want to rename it you can pass name argument to the init(name)
method.
var elixir = require('laravel-elixir');
require('laravel-elixir-browserify').init("bundler");
elixir(function(mix) {
mix.bundler("bootstrap.js");
});
0.8.1
- Updated browserify
0.8.0
- Resolved conflicts with browserify elixir task
- Better watchify integration
0.7.0
- Added multiple bundles support (thanks for @Daveawb)
- Added watchify support (thanks for @Daveawb)
0.6.0
- Removed second argument (destination directory) and add output option.
- Fixed browserify transforms (vinyl-transform replaced by vinyl-source-stream and vinyl-buffer)
0.5.0
- Default bundle file has the same name as input file. Use rename option to change it.
0.4.1
- Renamed the helpers folder to commands
0.4.0
- Replace blacklisted gulp-browserify with browserify and vinyl-transform packages (thanks for @JoeCianflone).
- Removed default debowerify transform.
The MIT License. Copyright (c) 2015 - 2017 by Szymon Krajewski and many contributors.