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:
@@ -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']
|
||||||
|
|||||||
Reference in New Issue
Block a user