@@ -794,8 +794,8 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915
794
794
if settings .WASM_ESM_INTEGRATION :
795
795
diagnostics .warning ('experimental' , '-sWASM_ESM_INTEGRATION is still experimental and not yet supported in browsers' )
796
796
default_setting ('MODULARIZE' , 'instance' )
797
- if options . oformat != OFormat . MJS :
798
- exit_with_error ('WASM_ESM_INTEGRATION is only compatible with EM module output format ' )
797
+ if not settings . EXPORT_ES6 :
798
+ exit_with_error ('WASM_ESM_INTEGRATION requires EXPORT_ES6 ' )
799
799
if settings .MODULARIZE != 'instance' :
800
800
exit_with_error ('WASM_ESM_INTEGRATION requires MODULARIZE=instance' )
801
801
if settings .RELOCATABLE :
@@ -813,10 +813,12 @@ def limit_incoming_module_api():
813
813
814
814
if settings .MODULARIZE == 'instance' :
815
815
diagnostics .warning ('experimental' , 'MODULARIZE=instance is still experimental. Many features may not work or will change.' )
816
- if options . oformat != OFormat . MJS :
817
- exit_with_error ('MODULARIZE=instance is only compatible with ES module output format ' )
816
+ if not settings . EXPORT_ES6 :
817
+ exit_with_error ('MODULARIZE=instance requires EXPORT_ES6 ' )
818
818
if settings .ABORT_ON_WASM_EXCEPTIONS :
819
819
exit_with_error ('MODULARIZE=instance is only compatible with ABORT_ON_WASM_EXCEPTIONS' )
820
+ if options .use_preload_plugins or len (options .preload_files ):
821
+ exit_with_error ('MODULARIZE=instance is not compatile with --embed-file/--preload-file' )
820
822
if 'INCOMING_MODULE_JS_API' in user_settings :
821
823
for s in ['wasmMemory' , 'INITIAL_MEMORY' ]:
822
824
if s in settings .INCOMING_MODULE_JS_API :
0 commit comments