You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

90 lines
2.7 KiB

module.exports = {
//路径前缀
publicPath: "./",
lintOnSave: true,
productionSourceMap: true,
chainWebpack: (config) => {
//忽略的打包文件
config.externals({
'vue': 'Vue',
'vue-router': 'VueRouter',
'vuex': 'Vuex',
'axios': 'axios',
'element-ui': 'ELEMENT',
});
const entry = config.entry('app');
entry.add('babel-polyfill').end();
entry.add('classlist-polyfill').end();
entry.add('@/mock').end();
},
pluginOptions:{
electronBuilder:{
builderOptions: {
appId: 'com.utils.hub',
productName: '金巢机械产销采系统',
directories: {
output: 'build'
},
extraResources: [
{
"from": "config.json",
"to": "../config.json", // 打包到资源目录外
"filter": ["**/*"]
},
{
"from": "未上传目录",
"to": "../未上传目录/", // 打包到资源目录外
"filter": ["**/*"]
},
{
"from": "api.log",
"to": "../api.log", // 打包到资源目录外
"filter": ["**/*"]
}
],
win: {
// 应用图标,这里要确保图标文件存在且路径正确,一般为.ico 格式
icon: 'public/winIcon/app.ico',
// 目标架构,可以是 x64、ia32 等,根据实际需求选择
target: [
{
target: 'nsis', // 使用 NSIS 打包
arch: ["ia32"] // 指定架构
}
]
},
// win: {
// // 应用图标,这里要确保图标文件存在且路径正确,一般为.ico 格式
// icon: 'public/winIcon/app.ico',
// // 目标架构,可以是 x64、ia32 等,根据实际需求选择
// target: [
// {
// target: 'nsis', // 使用 NSIS 打包
// arch: ['x64'] // 指定架构
// }
// ]
// },
}
}
},
css: {
extract: { ignoreOrder: true }
},
//开发模式反向代理配置,生产模式请使用Nginx部署并配置反向代理
devServer: {
port: 1888,
proxy: {
'/api': {
//本地服务接口地址
// target: 'http://localhost',
//远程演示服务地址,可用于直接启动项目
// target: 'https://saber.bladex.cn/api',
target:'http://192.168.0.220:8090/',
ws: true,
pathRewrite: {
'^/api': '/'
}
}
}
}
};