49 lines
1.1 KiB
JavaScript
49 lines
1.1 KiB
JavaScript
import { VantResolver } from "@vant/auto-import-resolver";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import { fileURLToPath, URL } from 'node:url';
|
|
import AutoImport from "unplugin-auto-import/vite";
|
|
import Components from "unplugin-vue-components/vite";
|
|
import { defineConfig } from "vite";
|
|
|
|
// import vueDevTools from 'vite-plugin-vue-devtools';
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
server: {
|
|
proxy: {
|
|
'^/poster': {
|
|
target: 'http://localhost:9600',
|
|
changeOrigin: true,
|
|
// rewrite: (path) => path.replace(/^\/api/, '')
|
|
},
|
|
'^/v1': {
|
|
target: 'http://localhost:9600',
|
|
changeOrigin: true,
|
|
// rewrite: (path) => path.replace(/^\/api/, '')
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
vue(),
|
|
// vueDevTools(),
|
|
AutoImport({
|
|
imports: [
|
|
'vue',
|
|
'vue-router',
|
|
'pinia',
|
|
],
|
|
resolvers: [VantResolver()],
|
|
}),
|
|
Components({
|
|
resolvers: [
|
|
VantResolver(),
|
|
],
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
},
|
|
},
|
|
})
|