06.10.2016 Views

laravel-5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Laravel Elixir 329<br />

1 elixir(function(mix) {<br />

2 A> mix.browserify('main.js');<br />

3<br />

4 });<br />

5<br />

6 // Specifying a specific output filename...<br />

7 elixir(function(mix) {<br />

8 A> mix.browserify('main.js', 'public/javascripts/main.js');<br />

9<br />

10 });<br />

While Browserify ships with the Partialify and Babelify transformers, you’re free to install and add<br />

more if you wish:<br />

1 npm install aliasify --save-dev<br />

1 elixir.config.js.browserify.transformers.push({<br />

2 A> name: 'aliasify',<br />

3 A> options: {}<br />

4<br />

5 });<br />

6<br />

7 elixir(function(mix) {<br />

8 A> mix.browserify('main.js');<br />

9<br />

10 });<br />

Babel<br />

The babel method may be used to compile ECMAScript 6 and 7¹⁷⁶ and JSX¹⁷⁷ into plain JavaScript.<br />

This function accepts an array of files relative to the resources/assets/js directory, and generates<br />

a single all.js file in the public/js directory:<br />

¹⁷⁶https://babeljs.io/docs/learn-es2015/<br />

¹⁷⁷https://facebook.github.io/react/docs/jsx-in-depth.html

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!