Registry / web-framework / laravel-elixir-babel

laravel-elixir-babel

JSON →
library0.2.0jsnpmunverified

Laravel Elixir extension for transpiling ES6 JavaScript to ES5 using Babel. Version 0.2.0 is the latest stable release, last updated in 2015. This package allows mix.babel() calls in Laravel's Gulpfile to compile ES6 code with optional sourcemaps. It is part of the legacy Laravel Elixir ecosystem (v5/6) and is not compatible with Laravel Mix or modern build workflows. No longer maintained.

npm install laravel-elixir-babel
INSTALL
IMPORT
SIG · LARAVEL-ELIXIR-BAB
L
laravel-elixir-babel
web-frameworkjavascriptv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
var elixir = require('laravel-elixir'); require('laravel-elixir-babel');
import elixir from 'laravel-elixir'; // Not supported with gulpfile
Must require the package to register mix.babel(). No exported symbol.
mix.babel
mix.babel('app.js')
mix.babel('app.js').scripts() // Not chainable like elixir's default mix methods
Only accepts a string path or options object.
mix.babel (with options)
mix.babel('app.js', { srcDir: 'resources/js', output: 'public/js', sourceMaps: true })
mix.babel(['app.js', 'other.js']) // Array not supported
Single file only; use elixir's scripts() for multiple files.

Install the package, require it in your Gulpfile, and call mix.babel() to transpile ES6 to ES5 using Babel.

var elixir = require('laravel-elixir'); require('laravel-elixir-babel'); elixir(function(mix) { mix.babel('app.js'); });
Debug
Known issues
deprecatedPackage is unmaintained since 2015. Babel has evolved significantly (v6, v7) and this extension does not support modern Babel configurations.
fix
Use Laravel Mix with Webpack (laravel-mix) instead, which includes Babel via mix.js().
affects: >=0.0.0
gotchaDoes not work with Laravel Mix or Laravel 5.4+; only compatible with the old Laravel Elixir (v5/6) and Gulp.
fix
Upgrade to Laravel Mix and use mix.js() for Babel transpilation.
affects: >=0.0.0
gotchaSourcemaps may not work correctly in all browsers or tools due to outdated gulp-babel integration.
fix
Set sourceMaps: true in options but verify with browser developer tools.
affects: >=0.0.0
gotchaCannot transpile multiple files at once; only a single entry file is supported per call.
fix
Use elixir.scripts() combined with Babel CLI or switch to Laravel Mix.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'laravel-elixir'
Missing required peer dependency laravel-elixir.
fix
Install laravel-elixir: npm install laravel-elixir --save-dev
mix.babel is not a function
The package require('laravel-elixir-babel') is missing or placed incorrectly.
fix
Add require('laravel-elixir-babel') after requiring elixir.
SyntaxError: Unexpected token import
ES6 import syntax used inside Gulpfile or source files without Babel configuration.
fix
Ensure Babel is configured via .babelrc or use CommonJS require() in Gulpfile.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
laravel-elixirrequiredRequired peer dependency for mix.babel() API
babel-corerequiredTranspilation engine
gulp-babelrequiredGulp plugin for Babel
Agent activity
2 hits · last 30 days
node
2
Resources
laravel-elixir-babel — npm install laravel-elixir-babel · libregistry