const Path = require('path'); const FileSystem = require('fs-extra'); async function copyAssets() { console.log('Copying static assets from public directory...'); // 注释:icon 和 image 资源已统一由 public 目录管理 // electron-builder 会直接从 public 打包这些资源到 app.asar.unpacked // 不需要复制到 build/renderer,避免重复打包导致体积增大 // const publicDir = Path.join(__dirname, '..', 'public'); // const buildRendererDir = Path.join(__dirname, '..', 'build', 'renderer'); // 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 copy skipped (resources managed by public directory).'); } module.exports = copyAssets;