unplugin-vue2
v0.1.1
Published
[![NPM version](https://img.shields.io/npm/v/unplugin-vue2?color=a1b858&label=)](https://www.npmjs.com/package/unplugin-vue2)
Downloads
610
Maintainers
Readme
unplugin-vue2
💎 Features
- ⚡️ Supports Vite, Webpack, Vue CLI, Rollup, esbuild and more, powered by unplugin.
📦 Installation
$ npm install unplugin-vue2 -D
$ yarn add unplugin-vue2 -D
$ pnpm add unplugin-vue2 -D
🚀 Usage
// vite.config.ts
import UnpluginVue2 from "unplugin-vue2/vite";
export default defineConfig({
plugins: [
UnpluginVue2({/* options */}),
],
});
// rollup.config.js
import UnpluginVue2 from "unplugin-vue2/rollup";
export default {
plugins: [
UnpluginVue2({/* options */}),
// other plugins
],
};
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require("unplugin-vue2/webpack")({/* options */}),
],
};
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require("unplugin-vue2/webpack")({/* options */}),
],
},
};
// 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.config.js
import { build } from "esbuild";
build({
/* ... */
plugins: [
require("unplugin-vue2/esbuild")({
/* options */
}),
],
});
👍 Alternatives
- @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.
📚 Credits
- Vite - Next generation frontend tooling. It's fast!
- unplugin - Unified plugin system for Vite, Rollup, Webpack, and more
🙇 Thanks
Thanks to Vite. This project is inherited from @vitejs/[email protected]. Thanks to unplugin-vue for this idea (porting @vitejs/plugin-vue2 to unplugin).