-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
43 lines (40 loc) · 1.19 KB
/
vite.config.js
File metadata and controls
43 lines (40 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
// 加載環境變數
const env = loadEnv(mode, process.cwd(), '')
return {
base: '/Earthquake_Visualization/', // 設置為你的 GitHub Pages 路徑
publicPath: '/earthquake-visualization',
plugins: [
vue({
include: [/\.vue$/],
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@assets': path.resolve(__dirname, './src/assets'),
'@components': path.resolve(__dirname, './src/components'),
'@views': path.resolve(__dirname, './src/views'),
},
},
server: {
port: 5000, // 設置開發服務器端口
open: true, // 自動打開瀏覽器
},
build: {
outDir: 'dist', // 構建輸出目錄
assetsDir: 'assets', // 靜態資源目錄
minify: 'terser', // 使用 terser 進行壓縮
terserOptions: {
compress: {
drop_console: true, // 生產環境下移除 console
drop_debugger: true // 生產環境下移除 debugger
}
}
}
}
})