Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unplugin/unplugin-vue2
✨ Transform Vue 2.7+ SFC to JavaScript. Supports Vite, esbuild, Rollup and Webpack.
https://github.com/unplugin/unplugin-vue2
esbuild plugin rollup sfc unplugin vite vue-cli vuejs webpack
Last synced: 23 days ago
JSON representation
✨ Transform Vue 2.7+ SFC to JavaScript. Supports Vite, esbuild, Rollup and Webpack.
- Host: GitHub
- URL: https://github.com/unplugin/unplugin-vue2
- Owner: unplugin
- License: mit
- Created: 2023-04-17T23:18:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-08T18:52:48.000Z (29 days ago)
- Last Synced: 2024-12-08T19:24:40.559Z (29 days ago)
- Topics: esbuild, plugin, rollup, sfc, unplugin, vite, vue-cli, vuejs, webpack
- Language: TypeScript
- Homepage:
- Size: 858 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unplugin-vue2
[![NPM version](https://img.shields.io/npm/v/unplugin-vue2?color=a1b858&label=)](https://www.npmjs.com/package/unplugin-vue2)
## 💎 Features
- ⚡️ Supports Vite, Webpack, Vue CLI, Rollup, esbuild and more, powered by unplugin.
## 📦 Installation
```bash
$ npm install unplugin-vue2 -D
$ yarn add unplugin-vue2 -D
$ pnpm add unplugin-vue2 -D
```## 🚀 Usage
Vite
```ts
// vite.config.ts
import UnpluginVue2 from "unplugin-vue2/vite";export default defineConfig({
plugins: [
UnpluginVue2({
/* options */
}),
],
});
```
Rollup
```ts
// rollup.config.js
import UnpluginVue2 from "unplugin-vue2/rollup";export default {
plugins: [
UnpluginVue2({
/* options */
}),
// other plugins
],
};
```
Webpack
```ts
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require("unplugin-vue2/webpack")({
/* options */
}),
],
};
```
Vue CLI
```ts
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require("unplugin-vue2/webpack")({
/* options */
}),
],
},
};
```
Quasar
```ts
// quasar.conf.js [Vite]
module.exports = {
vitePlugins: [
[
"unplugin-vue2/vite",
{
/* options */
},
],
],
};
``````ts
// quasar.conf.js [Webpack]
const UnpluginVue2Plugin = require("unplugin-vue2/webpack");module.exports = {
build: {
chainWebpack(chain) {
chain.plugin("unplugin-vue2").use(
UnpluginVue2Plugin({
/* options */
}),
);
},
},
};
```
esbuild
```ts
// esbuild.config.js
import { build } from "esbuild";build({
/* ... */
plugins: [
require("unplugin-vue2/esbuild")({
/* options */
}),
],
});
```
## 👍 Alternatives
- [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue) - For Vite and Vue 3.
- [@vitejs/plugin-vue2](https://github.com/vitejs/vite-plugin-vue2) - For Vite and Vue 2.
- ~~[vite-plugin-vue2](https://github.com/underfin/vite-plugin-vue2) - For Vite and Vue 2.~~
- ~~[rollup-plugin-vue](https://github.com/vuejs/rollup-plugin-vue)~~ - ⚠️ no longer maintained.
- [unplugin-vue](https://github.com/unplugin/unplugin-vue) - For Vue3.
- [vue-loader](https://github.com/vuejs/vue-loader) - For Webpack.
- [esbuild-plugin-vue](https://github.com/egoist/esbuild-plugin-vue) - For esbuild and Vue 3.
- [esbuild-vue](https://github.com/apeschar/esbuild-vue) - For esbuild and Vue 2.## 📚 Credits
- [Vite](https://github.com/vitejs/vite) - Next generation frontend tooling. It's fast!
- [unplugin](https://github.com/unjs/unplugin) - Unified plugin system for Vite, Rollup, Webpack, and more## 🙇 Thanks
Thanks to [Vite](https://github.com/vitejs/vite). This project is inherited from [@vitejs/[email protected]](https://github.com/vitejs/vite-plugin-vue2/tree/v2.2.0).
Thanks to [unplugin-vue](https://github.com/sxzz/unplugin-vue) for this idea (porting @vitejs/plugin-vue2 to unplugin).## 📝 License
[MIT](./LICENSE). Made with ❤️ by [Ray](https://github.com/so1ve)