12345678910111213141516171819202122232425262728293031323334 |
- import { fileURLToPath, URL } from "node:url"
- import { defineConfig } from "vite"
- import vue from "@vitejs/plugin-vue"
- import vueJsx from "@vitejs/plugin-vue-jsx"
- // https://vite.dev/config/
- export default defineConfig({
- plugins: [vue(), vueJsx()],
- css: {
- preprocessorOptions: {
- scss: {
- additionalData: `@use "@/assets/variables.scss" as *;`
- }
- }
- },
- resolve: {
- alias: {
- "@": fileURLToPath(new URL("./src", import.meta.url))
- }
- },
- server: {
- port: 9525,
- host: "0.0.0.0",
- proxy: {
- // 正则表达式写法
- "^/rhythmApi/.*": {
- target: "https://test.kt.colexiu.com",
- changeOrigin: true,
- rewrite: path => path.replace(/^\/rhythmApi/, "")
- }
- }
- }
- })
|