Closed klausxie closed 1 year ago
.umirc.ts 配置如下
import { defineConfig } from 'umi'; import { Platform, Arch } from '@umijs/plugin-electron'; export default defineConfig({ npmClient: 'yarn', plugins: ['@umijs/plugin-electron'], electron: { builder: { targets: Platform.MAC.createTarget(['dmg'], Arch.x64), config: { mac: { icon: "build/icons/icon.icns", } }, } }, });
项目目录结构:
app - build/icons/icon.icns - node_modules - src - .umirc.ts
构建出现提示: default Electron icon is used reason=application icon is not set
default Electron icon is used reason=application icon is not set
找到问题了
build 目录需求放在 .electron-production 目录下
app - .electron-production/build/icons/icon.icns - node_modules - src - .umirc.ts
.umirc.ts 配置如下
项目目录结构:
构建出现提示:
default Electron icon is used reason=application icon is not set