9b7e125f
monkeyhouyi
属地页面
|
1
2
3
4
5
6
|
const { defineConfig } = require('@vue/cli-service')
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
const CompressionPlugin = require('compression-webpack-plugin')
|
6d366830
monkeyhouyi
系统名称-E蓉管理
|
7
8
|
const name = 'E蓉管理' // page title
|
9b7e125f
monkeyhouyi
属地页面
|
9
10
|
module.exports = defineConfig({
|
c8753517
monkeyhouyi
前端页面整改
|
11
|
|
9b7e125f
monkeyhouyi
属地页面
|
12
13
14
15
16
|
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
productionSourceMap: false,
transpileDependencies: true,
lintOnSave: false,
devServer: {
|
3662215e
monkeyhouyi
有害清单,应用详情
|
17
|
port: 8032,
|
9b7e125f
monkeyhouyi
属地页面
|
18
19
20
21
|
open: true,
proxy: {
'/api': {
// 跨域请求的地址
|
fbae19a1
monkeyhouyi
隐藏登陆人
|
22
|
target: process.env.VUE_APP_BASE_API + '/api',
|
9b7e125f
monkeyhouyi
属地页面
|
23
24
25
26
27
28
|
changeOrigin: true, // 是否允许跨域请求,在本地会创建一个虚拟服务端,发送接收请求数据,这样服务端和服务端进行数据的交互就不会有跨域问题
// 路径重写,替换请求地址
pathRewrite: {
'^/api': ''
}
}
|
ecc43230
monkeyhouyi
优化首页,应用管理
|
29
|
},
|
2201a66b
monkeyhouyi
专项性行动-首页联动
|
30
31
32
33
|
client: {
// webSocketURL: "http://localhost:8080"
overlay: false
},
|
9b7e125f
monkeyhouyi
属地页面
|
34
35
|
},
configureWebpack: {
|
6d366830
monkeyhouyi
系统名称-E蓉管理
|
36
|
name: name,
|
9b7e125f
monkeyhouyi
属地页面
|
37
38
|
resolve: {
alias: {
|
4424f41c
monkeyhouyi
网信执法、清单管理静态页面
|
39
40
|
'@': resolve('src'),
'static': resolve('static') // 增加这一行代码
|
9b7e125f
monkeyhouyi
属地页面
|
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
}
},
plugins: [
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
new CompressionPlugin({
cache: false, // 不启用文件缓存
test: /\.(js|css|html|jpe?g|png|gif|svg)?$/i, // 压缩文件格式
filename: '[path][base].gz[query]', // 压缩后的文件名
algorithm: 'gzip', // 使用gzip压缩
minRatio: 0.8, // 压缩比例,小于 80% 的文件不会被压缩
deleteOriginalAssets: false // 压缩后删除原文件
})
],
},
|
c8753517
monkeyhouyi
前端页面整改
|
55
56
57
58
59
60
61
62
|
chainWebpack(config) {
config.externals({
// 'monaco-editor': 'monaco-editor',
'echarts': 'echarts'
})
// when there are many pages, it will cause too many meaningless requests
config.plugins.delete('prefetch')
|
6d366830
monkeyhouyi
系统名称-E蓉管理
|
63
64
65
66
67
|
config.plugin('html')
.tap(args => {
args[0].title = name;
return args;
})
|
c8753517
monkeyhouyi
前端页面整改
|
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
// set svg-sprite-loader
config.module
.rule('svg')
.exclude.add(resolve('src/icons'))
.end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
},
|
9b7e125f
monkeyhouyi
属地页面
|
87
88
89
90
91
|
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
outputDir: 'dist',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir: 'static',
})
|