41
41
42
42
--export-name=EXPORT_NAME Use custom export name (default is `Module`)
43
43
44
- --modularize Wrap generated code inside ES6 exported function
44
+ --export-es6 Wrap generated code inside ES6 exported function
45
45
46
46
--no-force Don't create output if no valid input file is specified.
47
47
@@ -131,7 +131,7 @@ def __init__(self):
131
131
self .use_preload_plugins = False
132
132
self .support_node = True
133
133
self .wasm64 = False
134
- self .modularize = False
134
+ self .export_es6 = False
135
135
136
136
137
137
class DataFile :
@@ -394,8 +394,8 @@ def main(): # noqa: C901, PLR0912, PLR0915
394
394
elif arg == '--no-force' :
395
395
options .force = False
396
396
leading = ''
397
- elif arg == '--modularize ' :
398
- options .modularize = True
397
+ elif arg == '--export-es6 ' :
398
+ options .export_es6 = True
399
399
leading = ''
400
400
elif arg == '--use-preload-cache' :
401
401
options .use_preload_cache = True
@@ -491,8 +491,8 @@ def main(): # noqa: C901, PLR0912, PLR0915
491
491
diagnostics .error ('TARGET should not be the same value of --js-output' )
492
492
return 1
493
493
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 '
496
496
'within emcc\' s code' )
497
497
return 1
498
498
@@ -632,7 +632,7 @@ def generate_js(data_target, data_files, metadata):
632
632
if options .from_emcc :
633
633
ret = ''
634
634
else :
635
- if options .modularize :
635
+ if options .export_es6 :
636
636
ret = 'export default function loadDataFile(Module) {'
637
637
638
638
else :
@@ -643,7 +643,7 @@ def generate_js(data_target, data_files, metadata):
643
643
Module['expectedDataFileDownloads'] ??= 0;
644
644
Module['expectedDataFileDownloads']++;'''
645
645
646
- if not options .modularize :
646
+ if not options .export_es6 :
647
647
ret += '''
648
648
(() => {'''
649
649
@@ -1158,7 +1158,7 @@ def generate_js(data_target, data_files, metadata):
1158
1158
}
1159
1159
loadPackage(%s);\n ''' % json .dumps (metadata )
1160
1160
1161
- if options .modularize :
1161
+ if options .export_es6 :
1162
1162
ret += '\n };\n // END the loadDataFile function\n '
1163
1163
else :
1164
1164
ret += '''
0 commit comments