4141
4242 --export-name=EXPORT_NAME Use custom export name (default is `Module`)
4343
44- --modularize Wrap generated code inside ES6 exported function
44+ --export-es6 Wrap generated code inside ES6 exported function
4545
4646 --no-force Don't create output if no valid input file is specified.
4747
@@ -131,7 +131,7 @@ def __init__(self):
131131 self .use_preload_plugins = False
132132 self .support_node = True
133133 self .wasm64 = False
134- self .modularize = False
134+ self .export_es6 = False
135135
136136
137137class DataFile :
@@ -394,8 +394,8 @@ def main(): # noqa: C901, PLR0912, PLR0915
394394 elif arg == '--no-force' :
395395 options .force = False
396396 leading = ''
397- elif arg == '--modularize ' :
398- options .modularize = True
397+ elif arg == '--export-es6 ' :
398+ options .export_es6 = True
399399 leading = ''
400400 elif arg == '--use-preload-cache' :
401401 options .use_preload_cache = True
@@ -491,8 +491,8 @@ def main(): # noqa: C901, PLR0912, PLR0915
491491 diagnostics .error ('TARGET should not be the same value of --js-output' )
492492 return 1
493493
494- if options .from_emcc and options .modularize :
495- diagnostics .error ('Can\' t use modularize option together with --from-emcc since the code should be embedded '
494+ if options .from_emcc and options .export_es6 :
495+ diagnostics .error ('Can\' t use --export-es6 option together with --from-emcc since the code should be embedded '
496496 'within emcc\' s code' )
497497 return 1
498498
@@ -632,7 +632,7 @@ def generate_js(data_target, data_files, metadata):
632632 if options .from_emcc :
633633 ret = ''
634634 else :
635- if options .modularize :
635+ if options .export_es6 :
636636 ret = 'export default function loadDataFile(Module) {'
637637
638638 else :
@@ -643,7 +643,7 @@ def generate_js(data_target, data_files, metadata):
643643 Module['expectedDataFileDownloads'] ??= 0;
644644 Module['expectedDataFileDownloads']++;'''
645645
646- if not options .modularize :
646+ if not options .export_es6 :
647647 ret += '''
648648 (() => {'''
649649
@@ -1164,7 +1164,7 @@ def generate_js(data_target, data_files, metadata):
11641164 }
11651165 loadPackage(%s);\n ''' % json .dumps (metadata )
11661166
1167- if options .modularize :
1167+ if options .export_es6 :
11681168 ret += '\n };\n // END the loadDataFile function\n '
11691169 else :
11701170 ret += '''
0 commit comments