A Laravel Elixir extension for compiling ES6 javascript in your project to ES5 using the Babel transpiler with optional sourcemap support
npm install laravel-elixir-babel --save-dev
mix.babel(srcFile, options)
var elixir = require("laravel-elixir");
require("laravel-elixir-babel");
elixir(function(mix) {
mix.babel("app.js");
});
var elixir = require("laravel-elixir");
require("laravel-elixir-babel");
elixir(function(mix) {
mix.babel("app.js", {
srcDir: "resources/js",
output: "public/js",
sourceMaps: true
});
});
Please see the official Babel documention for the full list of options here: Babel Options