http/playground/vite.config.ts

31 lines
686 B
TypeScript
Raw Permalink Normal View History

2023-06-19 09:19:48 +08:00
import { URL, fileURLToPath } from 'url'
import Unocss from 'unocss/vite'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue({
reactivityTransform: true,
}),
Unocss(),
],
resolve: {
alias: {
'@crami/http': fileURLToPath(new URL('../src', import.meta.url)),
'~/': fileURLToPath(new URL('./src/', import.meta.url)),
},
},
server: {
proxy: {
'/api': {
target: 'http://10.0.59.229:7300/mock/622ff143ec91f63c580c0560',
rewrite: (path) => {
return path.replace(/^\/api/, '')
},
},
},
},
})