Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/underfin/vite-plugin-vue2
Vue2 plugin for Vite
https://github.com/underfin/vite-plugin-vue2
Last synced: 4 months ago
JSON representation
Vue2 plugin for Vite
- Host: GitHub
- URL: https://github.com/underfin/vite-plugin-vue2
- Owner: underfin
- Archived: true
- Created: 2020-07-04T10:39:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-16T23:10:02.000Z (about 2 years ago)
- Last Synced: 2024-10-12T18:30:52.025Z (4 months ago)
- Language: TypeScript
- Size: 1010 KB
- Stars: 619
- Watchers: 16
- Forks: 83
- Open Issues: 42
-
Metadata Files:
- Readme: README.MD
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- fucking-awesome-vite - v2 - Vue 2 integration. (Plugins / Vue)
- awesome-vite - v2 - Vue 2 integration. (Plugins / Vue)
README
# vite-plugin-vue2
[![NPM version](https://img.shields.io/npm/v/vite-plugin-vue2?color=a1b858&label=)](https://www.npmjs.com/package/vite-plugin-vue2)
> ⚠️ With the release of [Vue 2.7](https://blog.vuejs.org/posts/vue-2-7-naruto.html), Vite now provides the official Vue 2 plugin [`@vitejs/plugin-vue2`](https://github.com/vitejs/vite-plugin-vue2). Thereby this plugin will only support Vue 2.6 or earlier. **This project is reached End of Life by the end of 2022**.
## Install
```bash
npm install vite-plugin-vue2 -D
``````js
// vite.config.js
import { createVuePlugin } from 'vite-plugin-vue2'export default {
plugins: [
createVuePlugin(/* options */)
],
}
```## [Options](https://github.com/underfin/vite-plugin-vue2/blob/master/src/index.ts#L26)
### `vueTemplateOptions`
Type: `Object`
Default: `{ compilerOptions :{ whitespace: 'condense' } }`
**Note { whitespace: 'condense' } behavior**
* A whitespace-only text node between element tags is removed if it contains new lines. Otherwise, it is condensed into a single space.
* Consecutive whitespaces inside a non-whitespace-only text node are condensed into a single space.
Using condense mode will result in smaller compiled code size and slightly improved performance. However, it will produce minor visual layout differences compared to plain HTML in certain cases,if you want to keep whitespace behavior, please set `{ whitespace: 'preserve' }`
The options for `@vue/component-compiler-utils`.
### `jsx`
Type: `Boolean`
Default: `false`The options for jsx transform.
### `jsxOptions`
Type: `Object`
The options for `@vue/babel-preset-jsx`.
### `target`
Type: `String`
The options for esbuild to transform script code
## Todo
- SSR Build
- Sourcemap