Skip to content

Commit 6b9c9f7

Browse files
committed
chore(scripts/build): fix error with --build-minify
1 parent 28237fc commit 6b9c9f7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/build.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ export async function buildBundle(overrideConfig = {}) {
134134
const sdksDir = './node_modules/react-native/sdks'
135135
const binPath = `${sdksDir}/hermesc/${paths[process.platform]}`
136136

137-
execFileSync(binPath, ['-finline', '-strict', '-O', '-g1', '-reuse-prop-cache', '-optimized-eval', '-emit-binary', '-Wno-undefined-variable', '-out', config.outfile], {
138-
input: await readFile(config.outfile),
137+
const actualFile = overrideConfig.outfile ?? config.outfile;
138+
139+
execFileSync(binPath, ['-finline', '-strict', '-O', '-g1', '-reuse-prop-cache', '-optimized-eval', '-emit-binary', '-Wno-undefined-variable', '-out', actualFile], {
140+
input: await readFile(actualFile),
139141
stdio: 'pipe'
140142
});
141143

@@ -161,7 +163,7 @@ if (isThisFileBeingRunViaCLI) {
161163

162164
if (buildMinify) {
163165
const { timeTook } = await buildBundle({
164-
minify: true,
166+
minifyIdentifiers: true,
165167
outfile: config.outfile.replace(/\.js$/, ".min.js")
166168
});
167169

0 commit comments

Comments
 (0)