-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.player.config.js
64 lines (62 loc) · 1.63 KB
/
vite.player.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
// /vite.config.js
import react from "@vitejs/plugin-react";
import { defineConfig } from 'vite'
import path, { extname } from 'path';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
],
server: {
host: '0.0.0.0',
hmr: {
clientPort: 443
},
port: 8090,
proxy: {
'/v1': {
target: 'https://prev2.d8dcloud.com',
changeOrigin: true,
},
'/api': {
target: 'https://prev2.d8dcloud.com',
changeOrigin: true,
},
}
},
define: {
'process.env': process.env,
},
// 打包配置 npm run build
build: {
minify: "terser",
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true
},
format: {
comments: false,
beautify: false
}
},
rollupOptions: {
input: {//可以配置多个,表示多入口
index: path.resolve(__dirname, "player/build.html"),
},
output: {
manualChunks: {
// nutui: ['@nutui/nutui-react'],
// antd: ['antd'],
// WangEditor: [path.resolve(__dirname, "src/player/Wangeditor")],
reactResponsive: ['react-responsive'],
},
},
},
outDir: '../dist/player',
emptyOutDir: true
},
root: './player',
//base: '/',
base: 'https://d8dprev2.y2o.me/',
})