Skip to content

Commit c1a257d

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 d4bdb53 commit c1a257d

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
@@ -765,7 +765,7 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915
765765

766766
# Set the EXPORT_ES6 default early since it affects the setting of the
767767
# default oformat below.
768-
if settings.WASM_ESM_INTEGRATION or settings.MODULARIZE == 'instance':
768+
if settings.WASM_ESM_INTEGRATION or settings.SOURCE_PHASE_IMPORTS or settings.MODULARIZE == 'instance':
769769
default_setting('EXPORT_ES6', 1)
770770

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

806+
if settings.SOURCE_PHASE_IMPORTS:
807+
if not settings.EXPORT_ES6:
808+
exit_with_error('SOURCE_PHASE_IMPORTS requires EXPORT_ES6')
809+
806810
if settings.WASM_ESM_INTEGRATION:
807811
diagnostics.warning('experimental', '-sWASM_ESM_INTEGRATION is still experimental and not yet supported in browsers')
808812
default_setting('MODULARIZE', 'instance')

0 commit comments

Comments
 (0)