Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skrajewski/laravel-elixir-browserify
Laravel Elixir Browserify Extension
https://github.com/skrajewski/laravel-elixir-browserify
Last synced: 14 days ago
JSON representation
Laravel Elixir Browserify Extension
- Host: GitHub
- URL: https://github.com/skrajewski/laravel-elixir-browserify
- Owner: skrajewski
- Created: 2014-10-19T20:34:00.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-08-01T21:03:13.000Z (over 7 years ago)
- Last Synced: 2024-10-29T19:18:00.207Z (21 days ago)
- Language: JavaScript
- Size: 27.3 KB
- Stars: 18
- Watchers: 3
- Forks: 8
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Laravel Elixir Browserify
=========================[![Version](https://img.shields.io/npm/v/laravel-elixir-browserify.svg)](https://www.npmjs.com/package/laravel-elixir-browserify)
[![Dependencies](https://img.shields.io/david/skrajewski/laravel-elixir-browserify.svg)](https://david-dm.org/skrajewski/laravel-elixir-browserify)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](https://www.npmjs.com/package/laravel-elixir-browserify-official). Thanks for all contributors for their support.--------------
- [Install](#install)
- [Usage](#usage)
- [Example *Gulpfile.js*:](#example-gulpfilejs)
- [Advanced example](#advanced-example)
- [Watchify](#watchify)
- [Multiple bundles](#multiple-bundles)
- [Custom task name](#custom-task-name)
- [Changelog](#changelog)
- [License](#license)## Install
```
npm install --save-dev laravel-elixir-browserify
```## Usage
### Example *Gulpfile.js*:
```javascript
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
```javascript
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.```javascript
var elixir = require('laravel-elixir');
var browserify = require('laravel-elixir-browserify');elixir(function(mix) {
browserify.init();mix.browserify("bootstrap.js");
});
```### Multiple bundles
```javascript
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.```javascript
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.