Laravel Compiling Assets: Working With JavaScript

Mix.js('resources/js/app.js', 'public/js');

Vendor Extraction

If you intend to make frequent updates to your application's JavaScript, you should consider extracting all of your vendor libraries into their own file
Mix.js('resources/js/app.js', 'public/js')
   .extract(['vue'])

Vanilla JS

Mix.scripts([
    'public/js/admin.js',
    'public/js/dashboard.js'
], 'public/js/all.js');

Custom Webpack Configuration

Behind the scenes, Laravel Mix references a pre-configured webpack.config.js file to get you up and running as quickly as possible.

React in Laravel

Mix.react('resources/js/app.jsx', 'public/js');

Laravel Compiling Assets: Working With JavaScript — Structure map

Clickable & Draggable!

Laravel Compiling Assets: Working With JavaScript — Related pages: