From the course: Building Laravel and Vue.js 2 Web Apps

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using webpack with Laravel Mix

Using webpack with Laravel Mix

From the course: Building Laravel and Vue.js 2 Web Apps

Start my 1-month free trial

Using webpack with Laravel Mix

- [Instructor] Now it's time to take a look at Laravel Mix, which runs on top of the popular webpack module bundler to compile and bundle assets such as JavaScript files and C S S or Sass files. In our layouts file, we see asset here and here. That asset helper method returns an absolute URL with HTTP or HTTPS, depending on the current protocol. Those files are in public, js, and public css, and they're recreated whenever webpack processes changes in the corresponding files in the resources subdirectories. In this case, resources, jsapp.js, and under sass, this app.sass file here. Let's look inside app.js. First, this loads bootstrap.js, which in turn loads a number of libraries and utilities like Lodash, jQuery, and axios. In app.js, we're also adding Vue to the global scope and registering a global component called example component which is in the components folder here. And then of course down here, we're mounting our root view instance to a div with the ID app, which is in the…

Contents