34 lines
786 B
TypeScript
34 lines
786 B
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import Uni from '@uni-helper/plugin-uni'
|
|
import Components from '@uni-helper/vite-plugin-uni-components'
|
|
import { WotResolver } from '@uni-helper/vite-plugin-uni-components/resolvers'
|
|
import { defineConfig } from 'vite'
|
|
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
plugins: [
|
|
Components({
|
|
dts: true,
|
|
resolvers: [WotResolver()],
|
|
}),
|
|
// https://uni-helper.js.org/plugin-uni
|
|
Uni(),
|
|
],
|
|
server: {
|
|
proxy: {
|
|
// H5 联调:/api → 本地 GoFrame 服务
|
|
'/api': {
|
|
target: 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
rewrite: path => path.replace(/^\/api/, ''),
|
|
},
|
|
},
|
|
},
|
|
|
|
})
|