- ⚡️ Supports Vite, Webpack, Vue CLI, Rollup, esbuild and more, powered by unplugin.
$ npm install unplugin-vue2 -D
$ yarn add unplugin-vue2 -D
$ pnpm add unplugin-vue2 -D
Vite
// vite.config.ts
import UnpluginVue2 from "unplugin-vue2/vite";
export default defineConfig({
plugins: [
UnpluginVue2({
/* options */
}),
],
});
Rollup
// rollup.config.js
import UnpluginVue2 from "unplugin-vue2/rollup";
export default {
plugins: [
UnpluginVue2({
/* options */
}),
// other plugins
],
};
Webpack
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require("unplugin-vue2/webpack")({
/* options */
}),
],
};
Vue CLI
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require("unplugin-vue2/webpack")({
/* options */
}),
],
},
};
Quasar
// quasar.conf.js [Vite]
module.exports = {
vitePlugins: [
[
"unplugin-vue2/vite",
{
/* options */
},
],
],
};
// quasar.conf.js [Webpack]
const UnpluginVue2Plugin = require("unplugin-vue2/webpack");
module.exports = {
build: {
chainWebpack(chain) {
chain.plugin("unplugin-vue2").use(
UnpluginVue2Plugin({
/* options */
}),
);
},
},
};
esbuild
// esbuild.config.js
import { build } from "esbuild";
build({
/* ... */
plugins: [
require("unplugin-vue2/esbuild")({
/* options */
}),
],
});
- @vitejs/plugin-vue - For Vite and Vue 3.
- @vitejs/plugin-vue2 - For Vite and Vue 2.
vite-plugin-vue2 - For Vite and Vue 2.rollup-plugin-vue-⚠️ no longer maintained.- unplugin-vue - For Vue3.
- vue-loader - For Webpack.
- esbuild-plugin-vue - For esbuild and Vue 3.
- esbuild-vue - For esbuild and Vue 2.
- Vite - Next generation frontend tooling. It's fast!
- unplugin - Unified plugin system for Vite, Rollup, Webpack, and more
Thanks to Vite. This project is inherited from @vitejs/plugin-vue2@2.2.0. Thanks to unplugin-vue for this idea (porting @vitejs/plugin-vue2 to unplugin).