Skip to content

Commit

Permalink
fix(playgound): npm run serve后runtime无法打开
Browse files Browse the repository at this point in the history
由于vite.config.ts中配置了proxy,run serve的时候是不需要proxy的

fix #352
  • Loading branch information
roymondchen authored and jia000 committed Sep 19, 2022
1 parent f10ab21 commit ddf0fcd
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions playground/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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,
},
});
}));

0 comments on commit ddf0fcd

Please sign in to comment.