From a5a3472486df0aa13d456b91513b77036ccb29c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BC=A0=E9=BE=99?= Date: Thu, 8 Sep 2022 15:08:28 +0800 Subject: [PATCH] refactor: setupExtend replace with defineOptions --- build/plugin/index.js | 8 +------- build/plugin/unplugin.js | 2 ++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/build/plugin/index.js b/build/plugin/index.js index 0fca2b9..42a1a2d 100644 --- a/build/plugin/index.js +++ b/build/plugin/index.js @@ -1,11 +1,5 @@ import vue from '@vitejs/plugin-vue' -/** - * * 扩展setup插件,支持在script标签中使用name属性 - * usage: - */ -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)) diff --git a/build/plugin/unplugin.js b/build/plugin/unplugin.js index 2690bd5..cc13a6b 100644 --- a/build/plugin/unplugin.js +++ b/build/plugin/unplugin.js @@ -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,