chore: OXC Formatter
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
import Vue from '@vitejs/plugin-vue'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
|
||||
import { fileURLToPath, URL } from "node:url";
|
||||
import Vue from "@vitejs/plugin-vue";
|
||||
import { defineConfig, loadEnv } from "vite";
|
||||
import Vuetify, { transformAssetUrls } from "vite-plugin-vuetify";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({ mode }) => {
|
||||
@@ -9,8 +9,8 @@ export default defineConfig(({ mode }) => {
|
||||
// 本機開發改用 dev server 轉發 /api,避開瀏覽器的跨網域限制。
|
||||
// 在 .env.local 設定 API_PROXY_TARGET(例如內網後端位址)即可啟用;
|
||||
// 未設定時維持原行為(前端走 VITE_USE_MOCK 的模擬資料)。
|
||||
const env = loadEnv(mode, process.cwd(), '')
|
||||
const apiProxyTarget = env.API_PROXY_TARGET
|
||||
const env = loadEnv(mode, process.cwd(), "");
|
||||
const apiProxyTarget = env.API_PROXY_TARGET;
|
||||
|
||||
return {
|
||||
plugins: [
|
||||
@@ -21,28 +21,28 @@ export default defineConfig(({ mode }) => {
|
||||
Vuetify({
|
||||
autoImport: true,
|
||||
styles: {
|
||||
configFile: 'src/styles/settings.scss',
|
||||
configFile: "src/styles/settings.scss",
|
||||
},
|
||||
}),
|
||||
],
|
||||
define: { 'process.env': {} },
|
||||
define: { "process.env": {} },
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('src', import.meta.url)),
|
||||
"@": fileURLToPath(new URL("src", import.meta.url)),
|
||||
},
|
||||
extensions: ['.js', '.json', '.jsx', '.mjs', '.ts', '.tsx', '.vue'],
|
||||
extensions: [".js", ".json", ".jsx", ".mjs", ".ts", ".tsx", ".vue"],
|
||||
},
|
||||
server: {
|
||||
port: 3678,
|
||||
proxy: apiProxyTarget
|
||||
? {
|
||||
'/api': {
|
||||
"/api": {
|
||||
target: apiProxyTarget,
|
||||
changeOrigin: true,
|
||||
rewrite: (path: string) => path.replace(/^\/api/, ''),
|
||||
rewrite: (path: string) => path.replace(/^\/api/, ""),
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
}
|
||||
})
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user