Skip to content

Commit d0b4283

Browse files
committed
[SOURCE_PHASE_IMPORTS] Using source phase imports should imply EXPORT_ES6
We do the same thing for WASM_ESM_INTEGRATION and MODULARIZE=instance already.
1 parent ffcd91b commit d0b4283

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/link.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915
758758

759759
# Set the EXPORT_ES6 default early since it affects the setting of the
760760
# default oformat below.
761-
if settings.WASM_ESM_INTEGRATION or settings.MODULARIZE == 'instance':
761+
if settings.WASM_ESM_INTEGRATION or settings.SOURCE_PHASE_IMPORTS or settings.MODULARIZE == 'instance':
762762
default_setting('EXPORT_ES6', 1)
763763

764764
# If no output format was specified we try to deduce the format based on
@@ -796,6 +796,10 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915
796796
if settings.JS_BASE64_API:
797797
diagnostics.warning('experimental', '-sJS_BASE64_API is still experimental and not yet supported in browsers')
798798

799+
if settings.SOURCE_PHASE_IMPORTS:
800+
if not settings.EXPORT_ES6:
801+
exit_with_error('SOURCE_PHASE_IMPORTS requires EXPORT_ES6')
802+
799803
if settings.WASM_ESM_INTEGRATION:
800804
diagnostics.warning('experimental', '-sWASM_ESM_INTEGRATION is still experimental and not yet supported in browsers')
801805
default_setting('MODULARIZE', 'instance')

0 commit comments

Comments
 (0)