Fix Vite config: replace Webpack devServer with Vite server, remove invalid envDir and transpileDependencies

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 08:28:46 +08:00
parent b07f1274e8
commit ffa45e2f07

View File

@@ -8,9 +8,6 @@ export default defineConfig(({ mode }) => {
return{ return{
plugins: [vue()], plugins: [vue()],
transpileDependencies: true,
// 環境變數
envDir: './env',
base: '/', // 這裡設置了 BASE_URL base: '/', // 這裡設置了 BASE_URL
// 設定路徑別名 // 設定路徑別名
resolve: { resolve: {
@@ -20,7 +17,7 @@ export default defineConfig(({ mode }) => {
'/images': 'src/assets/images', // EX:<img src="/images/logo.png"> '/images': 'src/assets/images', // EX:<img src="/images/logo.png">
} }
}, },
devServer: { server: {
host: 'localhost', host: 'localhost',
port: 58249, port: 58249,
proxy: { proxy: {
@@ -30,11 +27,6 @@ export default defineConfig(({ mode }) => {
rewrite: path => path.replace(/^\/api/, ''), // 修改實際的 Request Url將 '/api' 用 '' 替代 rewrite: path => path.replace(/^\/api/, ''), // 修改實際的 Request Url將 '/api' 用 '' 替代
} }
}, },
// hmr: {
// host: 'localhost',
// port: 3001,
// protocol: 'wss',
// }
}, },
optimizeDeps: { optimizeDeps: {
include: ['vue', 'vue-router', 'pinia', 'axios'] include: ['vue', 'vue-router', 'pinia', 'axios']