fix(next-swc): correctly set wasm fallback for known target triples (#64567)

### What

Fixes a regression to enable wasm fallback for the know target triples
(that does not have native bindings). The condition was skewed when
introducing `useWasmBinary` flag.

Closes PACK-2969
This commit is contained in:
OJ Kwon 2024-04-16 09:29:26 -07:00 committed by GitHub
parent ce69d02cf9
commit cc4f7f204e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -227,8 +227,11 @@ export async function loadBindings(
!!triple?.raw && knownDefaultWasmFallbackTriples.includes(triple.raw)
)
const isWebContainer = process.versions.webcontainer
// Normal execution relies on the param `useWasmBinary` flag to load, but
// in certain cases where there isn't a native binary we always load wasm fallback first.
const shouldLoadWasmFallbackFirst =
(!disableWasmFallback && unsupportedPlatform && useWasmBinary) ||
(!disableWasmFallback && useWasmBinary) ||
unsupportedPlatform ||
isWebContainer
if (!unsupportedPlatform && useWasmBinary) {