const Path = require('path'); const FileSystem = require('fs-extra'); async function copyAssets() { console.log('Copying static assets from public directory...'); const publicDir = Path.join(__dirname, '..', 'public'); const buildRendererDir = Path.join(__dirname, '..', 'build', 'renderer'); // 确保 build/renderer 下的 icon 和 image 目录存在且是最新的 // 这样打包后 renderer/icon 和 renderer/image 会包含所有图标 await FileSystem.copy( Path.join(publicDir, 'icon'), Path.join(buildRendererDir, 'icon'), { overwrite: true } ); await FileSystem.copy( Path.join(publicDir, 'image'), Path.join(buildRendererDir, 'image'), { overwrite: true } ); console.log('Static assets copied to build/renderer successfully!'); } module.exports = copyAssets;