From 5a05c6ee54a95740777332d27b70cf2c7f7f58a4 Mon Sep 17 00:00:00 2001 From: zhangchuanlong Date: Tue, 25 Jan 2022 16:26:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E6=8F=92=E4=BB=B6vite-p?= =?UTF-8?q?lugin-vue-setup-extend,=E6=94=AF=E6=8C=81=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=9C=A8setup=20script=E6=A0=87=E7=AD=BE=E5=AE=9A=E4=B9=89name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/vite/plugin/index.js | 5 +++-- package-lock.json | 10 ++++++++++ package.json | 3 ++- src/views/test-page/TestDialog.vue | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/build/vite/plugin/index.js b/build/vite/plugin/index.js index d537e86..8b75821 100644 --- a/build/vite/plugin/index.js +++ b/build/vite/plugin/index.js @@ -1,10 +1,11 @@ import vue from '@vitejs/plugin-vue' +import VueSetupExtend from 'vite-plugin-vue-setup-extend' +import { unocss } from './unocss' import { configHtmlPlugin } from './html' import { configMockPlugin } from './mock' -import { unocss } from './unocss' export function createVitePlugins(viteEnv, isBuild) { - const plugins = [vue(), unocss(), configHtmlPlugin(viteEnv, isBuild)] + const plugins = [vue(), VueSetupExtend(), unocss(), configHtmlPlugin(viteEnv, isBuild)] viteEnv?.VITE_APP_USE_MOCK && plugins.push(configMockPlugin(isBuild)) diff --git a/package-lock.json b/package-lock.json index a7274f5..dc65f7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2839,6 +2839,16 @@ } } }, + "vite-plugin-vue-setup-extend": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/vite-plugin-vue-setup-extend/-/vite-plugin-vue-setup-extend-0.3.0.tgz", + "integrity": "sha512-9Nd7Bj4TftB2CoOAD2ZI4cHLW5zjKMF3LNihWbrnAPx3nuGBn33tM9SVUGBVjBB6uv1mGAPavwKCTU0xAD8qhw==", + "dev": true, + "requires": { + "@vue/compiler-sfc": "^3.2.26", + "magic-string": "^0.25.7" + } + }, "vooks": { "version": "0.2.10", "resolved": "https://registry.npmjs.org/vooks/-/vooks-0.2.10.tgz", diff --git a/package.json b/package.json index c93b387..ce173fa 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "unocss": "^0.16.3", "vite": "^2.7.6", "vite-plugin-html": "^2.1.1", - "vite-plugin-mock": "^2.9.6" + "vite-plugin-mock": "^2.9.6", + "vite-plugin-vue-setup-extend": "^0.3.0" } } diff --git a/src/views/test-page/TestDialog.vue b/src/views/test-page/TestDialog.vue index f8c17d0..938d6d6 100644 --- a/src/views/test-page/TestDialog.vue +++ b/src/views/test-page/TestDialog.vue @@ -1,4 +1,4 @@ -