Browse Source

feat: 优化打包配置

master
cles 3 weeks ago
parent
commit
e8e4e9b354
  1. 59
      electron-builder.yml
  2. BIN
      releases/FlexometerSetup-1.1.0-setup.exe
  3. 8
      releases/latest.yml

59
electron-builder.yml

@ -2,12 +2,41 @@ appId: com.freesun.app
productName: FlexometerSetup productName: FlexometerSetup
directories: directories:
buildResources: build buildResources: build
output: dist
files: files:
- '!**/.vscode/*' - '!**/.vscode/*'
- '!src/*' - '!src/*'
- '!electron.vite.config.{js,ts,mjs,cjs}' - '!electron.vite.config.{js,ts,mjs,cjs}'
- '!{.eslintcache,eslint.config.mjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}' - '!{.eslintcache,eslint.config.mjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}' - '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
# 更全面的文件排除优化
- '!**/*.{md,txt,map,ts,tsx}'
- '!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme,LICENSE,LICENCE}'
- '!**/node_modules/*/{test,__tests__,tests,spec,specs,example,examples,demo,demos}'
- '!**/node_modules/*/{docs,doc,documentation}'
- '!**/node_modules/*/{coverage,nyc_output}'
- '!**/node_modules/*.d.ts'
- '!**/node_modules/.bin'
- '!**/node_modules/*/{tsconfig.json,tslint.json,eslint*}'
- '!**/node_modules/*/test/**'
- '!**/node_modules/*/tests/**'
- '!**/node_modules/*/spec/**'
- '!**/node_modules/*/examples/**'
- '!**/node_modules/*/example/**'
- '!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,.gitignore,.gitattributes,.gitmodules}'
- '!**/{thumbs.db,.flowconfig,.idea,.vs,.nyc_output,.coverage}'
- '!**/{appveyor.yml,.travis.yml,circle.yml,azure-pipelines.yml,.github}'
- '!**/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json,yarn-error.log}'
- '!**/{*.orig,*.rej,*.bak,*.tmp,*.swp,*~}'
- '!**/webpack.config.js'
- '!**/rollup.config.js'
- '!**/jest.config.js'
- '!**/babel.config.js'
# 启用最大压缩
compression: maximum
# 启用 asar 打包
asar: true
# 只在 Windows 平台构建时包含 extraResources
extraResources: extraResources:
- from: resources/adbSDK - from: resources/adbSDK
to: adbSDK to: adbSDK
@ -15,6 +44,10 @@ extraResources:
- '**/*' - '**/*'
win: win:
executableName: FlexometerSetup executableName: FlexometerSetup
target:
- target: nsis
arch:
- x64 # 只构建64位版本
nsis: nsis:
oneClick: false oneClick: false
allowToChangeInstallationDirectory: true allowToChangeInstallationDirectory: true
@ -22,28 +55,14 @@ nsis:
shortcutName: ${productName} shortcutName: ${productName}
uninstallDisplayName: ${productName} uninstallDisplayName: ${productName}
createDesktopShortcut: always createDesktopShortcut: always
mac: # 使用 zip 压缩而不是默认的 7z(更快的安装)
entitlementsInherit: build/entitlements.mac.plist useZip: true
extendInfo: # 移除了无效的 removeDefaultUninstallProgramMenu 属性
- NSCameraUsageDescription: Application requests access to the device's camera. # 使用有效的属性
- NSMicrophoneUsageDescription: Application requests access to the device's microphone. removeDefaultUninstallWelcomePage: true
- NSDocumentsFolderUsageDescription: Application requests access to the user's Documents folder.
- NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder.
notarize: false
dmg:
artifactName: ${name}-${version}.${ext}
linux:
target:
- AppImage
- snap
- deb
maintainer: electronjs.org
category: Utility
appImage:
artifactName: ${name}-${version}.${ext}
npmRebuild: false npmRebuild: false
publish: publish:
provider: generic provider: generic
url: https://gitea.anxinyun.cn/qinjian/FlexometerSetup/src/branch/master/releases url: https://gitee.com/bocinpity/flexometer-setup/releases/download/latest
electronDownload: electronDownload:
mirror: https://npmmirror.com/mirrors/electron/ mirror: https://npmmirror.com/mirrors/electron/

BIN
releases/FlexometerSetup-1.1.0-setup.exe

Binary file not shown.

8
releases/latest.yml

@ -1,8 +0,0 @@
version: 1.1.0
files:
- url: FlexometerSetup-1.1.0-setup.exe
sha512: g6DYUmHqd/2iFWTB8WR5/GDwWf0+wKZ7mi9GyXK/++8/Zv7LaU9Rzz7uC0UUnaB7BOUIEwromhIfjst4AJ7+8g==
size: 111063031
path: FlexometerSetup-1.1.0-setup.exe
sha512: g6DYUmHqd/2iFWTB8WR5/GDwWf0+wKZ7mi9GyXK/++8/Zv7LaU9Rzz7uC0UUnaB7BOUIEwromhIfjst4AJ7+8g==
releaseDate: '2025-10-15T00:40:56.114Z'
Loading…
Cancel
Save