March 2018
Beginner to intermediate
344 pages
7h 7m
English
Inside of our ./webpack-config.js within the standard webpack-simple template, we have a module object that allows us to set up our loader; this tells Webpack that we'd like it to use .vue files inside of our project:
module: { rules: [{ test: /\.vue$/, loader: 'vue-loader', options: { loaders: {} // other vue-loader options go here }}]
For this to work, Webpack runs a regular expression for anything that matches .vue and then passes this to our vue-loader to be transformed into a plain JavaScript module. In this simple example, we're loading files with a .vue extension, but vue-loader can be further customized and you may want to look into this further (https://goo.gl/4snNfD). We could certainly do this configuration ourselves, ...
Read now
Unlock full access