Files
zn-ai/build/scripts/generateProdEntry.js
duanshuwen 6615d11dd6 chore: restructure project and add i18n support
- Reorganize project structure with new electron and shared directories
- Add comprehensive i18n support with Chinese, English, and Japanese locales
- Update build configurations and TypeScript paths for new structure
- Add various UI components including chat interface and task management
- Include Windows release binaries and localization files
- Update dependencies and fix import paths throughout the codebase
2026-04-06 14:39:06 +08:00

24 lines
718 B
JavaScript

const fs = require('fs')
const path = require('path')
const entryPath = path.join(process.cwd(), 'dist-electron/main/main.js')
const jscPath = path.join(process.cwd(), 'dist-electron/main/main.jsc')
if (!fs.existsSync(entryPath)) {
throw new Error('主进程入口未找到,请先构建主进程')
}
if (!fs.existsSync(jscPath)) {
const bytenode = require('bytenode')
bytenode.compileFile({ filename: entryPath, output: jscPath })
}
const content = [
"require('bytenode')",
"require('./main.jsc')"
].join('\n')
const outputPath = entryPath
fs.mkdirSync(path.dirname(outputPath), { recursive: true })
fs.writeFileSync(outputPath, content)
console.log(`生产环境入口文件已生成: ${outputPath}`)