Bundling

The process of resolving modules into browser-friendly code is called bundling. Webpack begins the bundling process with the entry file as a starting point. In the Laravel frontend app, resources/assets/js/app.js is the entry file.

Webpack analyzes the entry file to find any dependencies. In the case of app.js, it will find three: bootstrapvue, and Example.vue.

resources/assets/js/app.js:

require('./bootstrap');

window.Vue = require('vue');

Vue.component('example', require('./components/Example.vue'));

...

Webpack will resolve these dependencies and then analyze them to find any dependencies that they might have. This process continues until all dependencies of the project are found. The result is a graph of dependencies that, ...

Get Full-Stack Vue.js 2 and Laravel 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.