node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

laravel-elixir-webpack

laravel-elixir-webpack

Simple extension to laravel elixir to build javascript bundle with webpack.

Install

npm install --save-dev laravel-elixir-webpack

Usage

Example Gulpfile:

var elixir = require('laravel-elixir');
 
require('laravel-elixir-webpack');
 
elixir(function(mix) {
    mix.webpack('app.js');
});

You can also use multiple entry points.

var elixir = require('laravel-elixir');
 
require('laravel-elixir-webpack');
 
elixir(function(mix) {
    mix.webpack(['app.js', 'backend.js']);
});

Advanced example

elixir(function(mix) {
    mix.webpack('app.js', {
        module: {
          loaders: [
            { test: /\.css$/, loader: 'style!css' },
          ],
        },
    });
});

Multiple entry points.

elixir(function(mix) {
    mix.webpack(['app.js', 'backend.js'], {
        module: {
          loaders: [
            { test: /\.css$/, loader: 'style!css' },
          ],
        },
    });
});

Setting an output file.

elixir(function(mix) {
    mix.webpack('app.js', {}, './your-public-path/app.js');
});