Skip to content

Commit cb177b4

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

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

bundler/bundle.js

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

436+
const isNative = process.env.EXODUS_TEST_IS_BAREBONE || process.env.EXODUS_TEST_PLATFORM === 'workerd'
436437
const config = {
437438
logLevel: 'silent',
438439
stdin: {
@@ -442,8 +443,8 @@ export const build = async (...files) => {
442443
bundle: true,
443444
outdir: options.outdir,
444445
entryNames: filename,
445-
platform: process.env.EXODUS_TEST_IS_BAREBONE ? 'neutral' : 'browser',
446-
conditions: process.env.EXODUS_TEST_IS_BAREBONE ? ['react-native'] : ['browser'],
446+
platform: isNative ? 'neutral' : 'browser',
447+
conditions: isNative ? ['react-native'] : ['browser'],
447448
mainFields: ['browser', 'module', 'main'], // FIXME: Removing 'browser' breaks some pkgs
448449
define: {
449450
'process.browser': stringify(true),

0 commit comments

Comments
 (0)