📦 Webpack loader for Vue.js components
webpack loader for Vue Single-File Components
NOTE: The master branch now hosts the code for v15! Legacy code is now in the v14 branch.
vue-loaderis a loader for webpack that allows you to author Vue components in a format called Single-File Components (SFCs):
There are many cool features provided by
.vuefile that can have custom loader chains applied to them;
In a nutshell, the combination of webpack and
vue-loadergives you a modern, flexible and extremely powerful front-end workflow for authoring Vue.js applications.
The following section is for maintainers and contributors who are interested in the internal implementation details ofvue-loader, and is not required knowledge for end users.
vue-loaderis not a simple source transform loader. It handles each language blocks inside an SFC with its own dedicated loader chain (you can think of each block as a "virtual module"), and finally assembles the blocks together into the final module. Here's a brief overview of how the whole thing works:
vue-loaderparses the SFC source code into an SFC Descriptor using
@vue/component-compiler-utils. It then generates an import for each language block so the actual returned module code looks like this:
// code returned from the main loader for 'source.vue'
// import the