vue-import-auto-loader
webpack loader to automatically import vue components as they're used
// webpack.config.js exportsmodulerules = test: /\.vue$/ use: loader: 'vue-import-auto-loader' options: /** * This function will be called for every tag used in each vue component * It should return an array, the first element will be inserted into the * components array, the second should be a corresponding import * * originalTag - the tag as it was originally used in the template * kebabTag - the tag normalised to kebab-case * camelTag - the tag normalised to PascalCase * path - a relative path to the current .vue file * component - a parsed representation of the current component */ { if kebabTag return camelTag `import from '@/components/core/.vue'` } /** * The loader also ships with some preset matchers */ preset: 'vuetify' 'vue-loader' exclude: /node_modules/
...
Will be compiled into:
...