Skip to content

Commit 1cdb95d

Browse files
committed
fix: don't treat workerd:bundle as a browser
1 parent f5ce630 commit 1cdb95d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

bundler/bundle.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ export const build = async (...files) => {
433433
: JSON.stringify(x, null, 1).replaceAll(/^ *(".+")(,?)$/gmu, (_, s, c) => `${wrap(s)}${c}`)
434434
}
435435

436+
const isNative =
437+
process.env.EXODUS_TEST_IS_BAREBONE || process.env.EXODUS_TEST_PLATFORM === 'workerd'
436438
const config = {
437439
logLevel: 'silent',
438440
stdin: {
@@ -442,8 +444,8 @@ export const build = async (...files) => {
442444
bundle: true,
443445
outdir: options.outdir,
444446
entryNames: filename,
445-
platform: process.env.EXODUS_TEST_IS_BAREBONE ? 'neutral' : 'browser',
446-
conditions: process.env.EXODUS_TEST_IS_BAREBONE ? ['react-native'] : ['browser'],
447+
platform: isNative ? 'neutral' : 'browser',
448+
conditions: isNative ? ['react-native'] : ['browser'],
447449
mainFields: ['browser', 'module', 'main'], // FIXME: Removing 'browser' breaks some pkgs
448450
define: {
449451
'process.browser': stringify(true),

0 commit comments

Comments
 (0)