优化 MAC 构建配置

This commit is contained in:
YILS
2025-10-22 23:56:15 +08:00
parent 56600b3353
commit f86ed53ccc
3 changed files with 10 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
All significant changes to this project will be recorded in this file.
此项目的所有显著更改都将记录在此文件中。
## [v1.1.9] - 2025-10-22
## [v1.1.10] - 2025-10-22
### Added
- Add MAC embedding FFmpeg support
### Fixed

View File

@@ -1,7 +1,7 @@
{
"name": "short-video-factory",
"description": "短视频工厂一键生成产品营销与泛内容短视频AI批量自动剪辑",
"version": "1.1.9",
"version": "1.1.10",
"author": {
"name": "YILS",
"developer": "YILS",

View File

@@ -25,10 +25,16 @@ function run(cmd, opts = {}) {
const archs = ['x64', 'arm64']
const ffmpegStaticDir = path.join(__dirname, '..', 'node_modules', 'ffmpeg-static')
// rebuild 两次
// 移除原来的二进制文件
run('rm -f ffmpeg', { cwd: ffmpegStaticDir })
// 获取两种架构的二进制文件
archs.forEach((arch) => {
run(
`pnpm cross-env FFMPEG_BINARIES_URL=${FFMPEG_BINARIES_URL} npm --arch=${arch} rebuild -f ffmpeg-static`,
`pnpm cross-env FFMPEG_BINARIES_URL=${FFMPEG_BINARIES_URL} npm_config_arch=${arch} npm run install`,
{
cwd: ffmpegStaticDir,
},
)
run(`mv ${ffmpegStaticDir}/ffmpeg ${ffmpegStaticDir}/ffmpeg-${arch}`)
})