refactor: setupExtend replace with defineOptions

This commit is contained in:
张传龙 2022-09-08 15:08:28 +08:00
parent fd1752693a
commit a5a3472486
2 changed files with 3 additions and 7 deletions

View File

@ -1,11 +1,5 @@
import vue from '@vitejs/plugin-vue'
/**
* * 扩展setup插件支持在script标签中使用name属性
* usage: <script setup name="MyComp"></script>
*/
import vueSetupExtend from 'vite-plugin-vue-setup-extend-plus'
/**
* * unocss插件原子css
* https://github.com/antfu/unocss
@ -22,7 +16,7 @@ import { configMockPlugin } from './mock'
import unplugin from './unplugin'
export function createVitePlugins(viteEnv, isBuild) {
const plugins = [vue(), vueSetupExtend(), ...unplugin, configHtmlPlugin(viteEnv, isBuild), Unocss()]
const plugins = [vue(), ...unplugin, configHtmlPlugin(viteEnv, isBuild), Unocss()]
if (viteEnv?.VITE_USE_MOCK) {
plugins.push(configMockPlugin(isBuild))

View File

@ -1,4 +1,5 @@
import { resolve } from 'path'
import DefineOptions from 'unplugin-vue-define-options/vite'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
@ -18,6 +19,7 @@ import { getSrcPath } from '../utils'
const customIconPath = resolve(getSrcPath(), 'assets/svg')
export default [
DefineOptions(),
AutoImport({
imports: ['vue', 'vue-router'],
dts: false,