vatson/rollup-plugin-vuetify(opens in a new tab)
Language: JavaScript
Vuetify autoloader š¤
- stars
- 19
- watchers
- 2
- forks
- 1
- open issues
- 43
- Last updated
- 10/27/2026
Language: JavaScript
Vuetify autoloader š¤
The plugin is a missing autoloader of vuetify components.
It eliminates the pain of manually importing all of the Vuetify components you use. It also allows you to use tree shaking as efficiently as possible.
This is a must if you decide to write your vuetify-based library.
Install the plugin with npm:
npm install --save-dev vue-template-compiler rollup-plugin-vuetify
Note: vue-template-compiler version must match your vue version
There is a configuration example for building a simple js library:
const { rollup } = require("rollup"); const vue = require("rollup-plugin-vue"); const postcss = require("rollup-plugin-postcss"); const vuetify = require("rollup-plugin-vuetify"); const build = async () => { try { const bundle = await rollup({ input: "src/index.js", external: ["vue", "vuetify/lib"], plugins: [ postcss(), vue(), vuetify({ include: 'src/**', exclude: 'someFolder/**' }/* options are optional */) ], }); bundle.write({ format: "esm", file: "dist/bundle.js", }); } catch (e) { console.error(e); } }; build();
You can also find the typescript example here demo/rollup.js
The demo/ folder and html preview were created as an example of how a project can be configured and what types of components can be used.
āāā dist
ā āāā browser.js <- fully compiled application without vue but with vuetify
ā āāā index.html <- demo with application to show that everything is ok
ā āāā ts.js <- bundled components with @rollup/plugin-typescript
ā āāā ts2.js <- bundled components with rollup-typescript-2
āāā rollup.js <- rollup configuration
āāā src
ā āāā App.vue <- application component
ā āāā Components <- components with all possible scenarios
ā ā āāā Complex.vue <- component with partial manual import
ā ā āāā Decorated.vue <- component decorated with `vue-property-decorator`
ā ā āāā Empty.vue <- component without any properties, can be used as a wrapper
ā ā āāā EmptyDecorator.vue <- component with "empty" decorator
ā ā āāā ExportByReference.vue <- component with export defined previously as a variable
ā ā āāā Extended.vue <- component created with Vue.extend()
ā ā āāā External <- component splitted into separate files
ā ā ā āāā Component.vue
ā ā ā āāā index.js
ā ā ā āāā script.js
ā ā ā āāā style.css
ā ā ā āāā template.html
ā ā āāā Simple.vue <- simple generic component
ā ā āāā WithEmptyScript.vue <- component with empty `script` section
ā ā āāā WithoutScript.vue <- component without `script` section, best choice for template chunks
ā ā āāā index.js
ā āāā index.js <- entry point to bundle components as es module without vue and vuetify
ā āāā main.js <- entry point of application
ā āāā shims-vue.d.ts
āāā tsconfig.json
script section;It works similarly to the vuetify-loader. But plugin uses AST transformation under the hood. It allows you to get rid of extra code and optimize your final bundle even more.