Laravel Elixir Webpack Official is a Gulp-based extension that integrates Webpack with Laravel Elixir, version 6 and up. It simplifies compiling ECMAScript 2015 (ES6) to plain JavaScript, with support for custom output paths, base directories, and webpack.config.js files. The current stable version is 1.0.10, released with no recent updates. Key differentiators include tight Laravel Elixir integration, automatic merging of user configurations via Elixir.webpack.mergeConfig, and compatibility with Elixir's build pipeline. This package is now largely superseded by Laravel Mix, which offers a more modern and flexible approach.
npm install laravel-elixir-webpack-officialVerified import paths — ran on the pinned version, not inferred.
Shows basic installation and usage of mix.webpack to compile an ES2015 JS file.
Switch to Laravel Mix (laravel-mix) for new projects, or migrate existing Elixir projects.
Verify the exact package name from npm or the Laravel documentation.
Test configuration thoroughly; use Elixir.webpack.mergeConfig for adjustments within Elixir context.
Specify the base directory explicitly: mix.webpack('app.js', 'public/dist', 'app/assets/js')Always wrap your mix calls inside elixir(function(mix) { ... }).Run: npm install laravel-elixir --save-dev
Ensure you have run: npm install laravel-elixir-webpack-official --save-dev, and require it in gulpfile (no explicit require needed as Elixir picks it up automatically).
Run: npm install babel-preset-es2015 --save-dev, then add presets to webpack.config.js or via Elixir.webpack.mergeConfig.
Pin webpack to version 2.x (npm install webpack@2 --save-dev), or migrate to Laravel Mix.