December 2017
Beginner to intermediate
376 pages
7h 53m
English
Part of what makes Webpack so powerful is that during the bundling process it can transform a module with one or more Webpack loaders.
For example, Babel is a compiler that transforms next-generation JavaScript syntax such as ES2015 into standard ES5. The Webpack Babel loader is one of the most popular as it allows developers to write their code using modern features, but still provide support in older browsers.
For example, in the entry file, we see the ES2015 const declaration that isn't supported by IE10.
resources/assets/js/app.js:
const app = new Vue({ el: '#app' });
If the Babel loader is used, const will be transformed to var before it's added to the bundle.
public/js/app.js:
var app = new Vue({ el: '#app' });
Read now
Unlock full access