- Windows exe:electron-builder 配置 + build:exe 一键打包 - Android APK:离线打包脚手架(命令打包,无需 Android Studio),包名/签名沿用散单项目 - 版本统一:package.json 三段版本,APK versionCode 自动推导 - 配置统一到 config/ 目录,含密钥文件 git 忽略并配套 example 模板 - env.js 接口地址改为环境变量注入,移除敏感信息 - 删除 info/basicinfo.txt(含账号/IP 数据) - tsconfig 移除已弃用的 baseUrl
40 lines
1001 B
JavaScript
40 lines
1001 B
JavaScript
/**
|
|
* electron-builder 打包配置(Windows exe)
|
|
* 由 scripts/build-exe.cjs 调用;前置产物为 dist/build/h5
|
|
* 产物输出到 release/ 目录
|
|
*/
|
|
module.exports = {
|
|
appId: 'com.wms.worker-station',
|
|
productName: 'WMS工作台',
|
|
copyright: 'Copyright © 2026',
|
|
asar: true,
|
|
// 直接复用 node_modules 里已安装的 Electron 发行版,
|
|
// 避免打包时重新下载 zip 并解压(可绕过 Windows 下 rename EPERM 问题)
|
|
electronDist: 'node_modules/electron/dist',
|
|
directories: {
|
|
output: 'release/windows',
|
|
},
|
|
files: [
|
|
'electron/**/*',
|
|
'dist/build/h5/**/*',
|
|
'!node_modules/**/*',
|
|
],
|
|
win: {
|
|
target: [
|
|
{
|
|
target: 'nsis',
|
|
arch: ['x64'],
|
|
},
|
|
],
|
|
artifactName: '${productName}-${version}-setup.${ext}',
|
|
},
|
|
nsis: {
|
|
oneClick: false,
|
|
perMachine: false,
|
|
allowToChangeInstallationDirectory: true,
|
|
createDesktopShortcut: true,
|
|
createStartMenuShortcut: true,
|
|
shortcutName: 'WMS工作台',
|
|
},
|
|
}
|