-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvite.config.js
69 lines (67 loc) · 1.58 KB
/
vite.config.js
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const path = require('path')
// vite.config.js # or vite.config.ts
function resolve(dir) {
return path.join(__dirname, dir)
}
export default defineConfig({
plugins: [
vue()
// eslintPlugin({
// include: ['src/**/*.vue'] // 检查的文件
// })
],
resolve: {
alias: {
'@': resolve('src')
},
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
},
css: {
preprocessorOptions: {
scss: {
modifyVars: {},
javascriptEnabled: true
}
}
},
server: {
host: 'aimeeadmin.mangoya.cn',
port: 8088,
// 是否自动在浏览器打开
open: true,
// 是否开启 https
https: false,
// 反向代理
proxy: {
'/v1': {
target: 'http://aimeeserver.mangoya.cn:8899/v1',
ws: true,
changeOrigin: true,
rewrite: path => path.replace(/^\/v1/, '')
}
},
fs: {
// Allow serving files from one level up to the project root
strict: true,
allow: ['..']
},
cors: true
// hmr: { overlay: false }
},
build: {
outDir: 'dist' // Specify the output directory (relative to project root).
},
/**
* 在生产中服务时的基本公共路径。
* @default '/'
*/
base: process.env.NODE_ENV === 'production' ? '//mangoya.cn/admin2.0/' : './',
/**
* 与“根”相关的目录,构建输出将放在其中。如果目录存在,它将在构建之前被删除。
* @default 'dist'
*/
outDir: 'dist',
assetsDir: 'static'
})