Skip to content

🎥 Make videos programmatically with React

Update build.mjs

Jonny Burger589ddc247921
diff --git a/packages/renderer/build.mjs b/packages/renderer/build.mjs
index cd8c15ebc3..9fbff41a62 100644
--- a/packages/renderer/build.mjs
+++ b/packages/renderer/build.mjs
@@ -10,7 +10,6 @@ import {
} from 'fs';
import os from 'os';
import path from 'path';
-import {VERSION} from 'remotion';
const isWin = os.platform() === 'win32';
const where = isWin ? 'where' : 'which';
@@ -259,14 +258,13 @@ for (const arch of archs) {
});
copyFileSync(copyInstructions.from, copyInstructions.to);
- execSync('npm pack', {
+ const output = execSync('npm pack --json', {
cwd: copyDestinations[arch].dir,
- stdio: 'ignore',
+ stdio: 'pipe',
});
- const filename = `remotion-${path.basename(
- copyDestinations[arch].dir
- )}-${VERSION}.tgz`;
+ const {files: filesArray} = JSON.parse(output.toString('utf-8'))[0];
+ const filename = filesArray[filesArray.length - 1].path;
const tgzPath = path.join(
process.cwd(),
copyDestinations[arch].dir,