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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
| /*
| * @Date: 2024-03-23 09:49:06
| * @LastEditors: lzhe lzhe@example.com
| * @LastEditTime: 2024-11-27 14:59:26
| * @FilePath: /cps-web/vue.config.js
| */
| const { defineConfig } = require('@vue/cli-service')
|
| module.exports = defineConfig({
| lintOnSave: false,
| //设置为空打包后不分更目录还是多级目录
| publicPath: '',
| //build编译后存放静态文件的目录
| //assetsDir: "static",
|
| // build编译后不生成资源MAP文件
| productionSourceMap: false,
|
| //开发服务,build后的生产模式还需nginx代理
| devServer: {
| allowedHosts: 'all',
| open: false, //运行后自动打开浏览器
| port: process.env.VUE_APP_PORT, //挂载端口
| proxy: {
| '/api/smart-collect': {
| target: 'http://120.46.212.231:5102',
| // ws: true,
| changeOrigin: true,
| pathRewrite: {
| '^/api': '/'
| }
| },
| '/workinghour': {
| target: 'http://120.46.212.231:5102',
| // ws: true,
| changeOrigin: true,
| pathRewrite: {
| '^/api': '/'
| }
| },
| '/api/smis/workstation/saveDatapoints': {
| target: 'http://120.46.212.231:5102',
| // ws: true,
| changeOrigin: true,
| pathRewrite: {
| '^/api': '/'
| }
| },
| '/api/smis/workstation/export-dp': {
| target: 'http://120.46.212.231:5102',
| // ws: true,
| changeOrigin: true,
| pathRewrite: {
| '^/api': '/'
| }
| },
| '/api': {
| target: process.env.VUE_APP_API_BASEURL,
| ws: true,
| pathRewrite: {
| // '^/api': '/'
| }
| },
|
| }
| },
|
| chainWebpack: config => {
| // 移除 prefetch 插件
| config.plugins.delete('preload');
| config.plugins.delete('prefetch');
| config.resolve.alias.set('vue-i18n', 'vue-i18n/dist/vue-i18n.cjs.js');
| },
|
| configureWebpack: {
| //性能提示
| performance: {
| hints: false
| },
| optimization: {
| splitChunks: {
| chunks: "all",
| automaticNameDelimiter: '~',
| name: "scuiChunks",
| cacheGroups: {
| //第三方库抽离
| vendor: {
| name: "modules",
| test: /[\\/]node_modules[\\/]/,
| priority: -10
| },
| elicons: {
| name: "elicons",
| test: /[\\/]node_modules[\\/]@element-plus[\\/]icons-vue[\\/]/
| },
| tinymce: {
| name: "tinymce",
| test: /[\\/]node_modules[\\/]tinymce[\\/]/
| },
| echarts: {
| name: "echarts",
| test: /[\\/]node_modules[\\/]echarts[\\/]/
| },
| xgplayer: {
| name: "xgplayer",
| test: /[\\/]node_modules[\\/]xgplayer.*[\\/]/
| },
| codemirror: {
| name: "codemirror",
| test: /[\\/]node_modules[\\/]codemirror[\\/]/
| }
| }
| }
| }
| }
| })
|
|