fix(playgound): npm run serve后runtime无法打开

由于vite.config.ts中配置了proxy,run serve的时候是不需要proxy的

fix #352
This commit is contained in:
roymondchen 2022-09-19 15:01:31 +08:00 committed by jia000
parent f10ab21ce8
commit ddf0fcdecc

View File

@ -23,8 +23,7 @@ import legacy from '@vitejs/plugin-legacy';
import vue from '@vitejs/plugin-vue'; import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx'; import vueJsx from '@vitejs/plugin-vue-jsx';
// https://vitejs.dev/config/ export default defineConfig(({ command }) => ({
export default defineConfig({
plugins: [ plugins: [
vue(), vue(),
vueJsx(), vueJsx(),
@ -67,17 +66,19 @@ export default defineConfig({
}, },
host: '0.0.0.0', host: '0.0.0.0',
port: 8098, port: 8098,
proxy: { proxy: command
'^/tmagic-editor/playground/runtime': { ? undefined
target: 'http://127.0.0.1:8078', : {
changeOrigin: true, '^/tmagic-editor/playground/runtime': {
prependPath: false, target: 'http://127.0.0.1:8078',
}, changeOrigin: true,
}, prependPath: false,
},
},
open: '/tmagic-editor/playground/', open: '/tmagic-editor/playground/',
}, },
build: { build: {
sourcemap: true, sourcemap: true,
}, },
}); }));