builder: keep un-wasm-opt'd .wasm if -work was passed

This commit is contained in:
Damian Gryski
2024-05-30 21:01:50 -07:00
committed by Damian Gryski
parent b6fd0c818e
commit 272fea13e7
+9 -1
View File
@@ -825,10 +825,18 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe
args = append(args, "--asyncify")
}
exeunopt := result.Executable
if config.Options.Work {
// Keep the work direction around => don't overwrite the .wasm binary with the optimized version
exeunopt += ".pre-wasm-opt"
os.Rename(result.Executable, exeunopt)
}
args = append(args,
opt,
"-g",
result.Executable,
exeunopt,
"--output", result.Executable,
)