minhquangqb / vite-vue2

Vue2 plugin for Vite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vite-vue2

Now you can use the following Babel features in SFC templates:

@babel/plugin-proposal-nullish-coalescing-operator
@babel/plugin-proposal-optional-chaining
@babel/plugin-transform-arrow-functions
@babel/plugin-transform-block-scoping
@babel/plugin-transform-destructuring
@babel/plugin-transform-parameters
@babel/plugin-transform-spread

Usage

  • run yarn add vite-plugin-vue2-enhanced --dev
  • add the plugin into vite.config.js
// vite.config.js
const { createVuePlugin } = require('vite-plugin-vue2')

module.exports = {
  plugins: [createVuePlugin(/*options*/)],
}

vueTemplateOptions

Type: Object
Default: null

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.

Todo

  • SSR Build
  • Sourcemap

About

Vue2 plugin for Vite


Languages

Language:TypeScript 88.2%Language:Vue 9.5%Language:JavaScript 1.1%Language:HTML 1.0%Language:CSS 0.2%Language:Sass 0.1%