leb

laravel-elixir-browserify

Laravel Elixir Browserify Extension

Showing:

Popularity

Downloads/wk

33

GitHub Stars

18

Maintenance

Last Commit

4yrs ago

Contributors

8

Package

Dependencies

10

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Deprecated!
This package will no longer updated. Please use the official one instead.

Readme

Laravel Elixir Browserify

Version Dependencies

Highly customizable browserify extension for laravel elixir. Includes support for transforms, watchify and multiple bundles.

❗️❗️ IMPORTANT NOTE ❗️❗️

Work to this package was abadonded. No further updates will be perfomed. Consider use the official package. Thanks for all contributors for their support.


Install

npm install --save-dev laravel-elixir-browserify

Usage

Example Gulpfile.js:

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.

Advanced example

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"
    });
});

Watchify

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");
});

Multiple bundles

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"] })
});

Custom task name

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");
});

Changelog

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.

License

The MIT License. Copyright (c) 2015 - 2017 by Szymon Krajewski and many contributors.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100