From ddf0fcdecce14a924ffbd3690a36fff467ca98bc Mon Sep 17 00:00:00 2001 From: roymondchen Date: Mon, 19 Sep 2022 15:01:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(playgound):=20npm=20run=20serve=E5=90=8Erun?= =?UTF-8?q?time=E6=97=A0=E6=B3=95=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由于vite.config.ts中配置了proxy,run serve的时候是不需要proxy的 fix #352 --- playground/vite.config.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/playground/vite.config.ts b/playground/vite.config.ts index b28210c8..38a737bf 100644 --- a/playground/vite.config.ts +++ b/playground/vite.config.ts @@ -23,8 +23,7 @@ import legacy from '@vitejs/plugin-legacy'; import vue from '@vitejs/plugin-vue'; import vueJsx from '@vitejs/plugin-vue-jsx'; -// https://vitejs.dev/config/ -export default defineConfig({ +export default defineConfig(({ command }) => ({ plugins: [ vue(), vueJsx(), @@ -67,17 +66,19 @@ export default defineConfig({ }, host: '0.0.0.0', port: 8098, - proxy: { - '^/tmagic-editor/playground/runtime': { - target: 'http://127.0.0.1:8078', - changeOrigin: true, - prependPath: false, - }, - }, + proxy: command + ? undefined + : { + '^/tmagic-editor/playground/runtime': { + target: 'http://127.0.0.1:8078', + changeOrigin: true, + prependPath: false, + }, + }, open: '/tmagic-editor/playground/', }, build: { sourcemap: true, }, -}); +}));