Skip to content

Commit 4c98511

Browse files
authored
Minify whitespace in modularization code (#24536)
1 parent ac84275 commit 4c98511

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1263
1+
1236
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2588
1+
2556

tools/building.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,13 @@ def closure_compiler(filename, advanced=True, extra_closure_args=None):
618618
if settings.DEBUG_LEVEL > 1:
619619
args += ['--debug']
620620

621+
# Now that we have run closure compiler once, we have stripped all the closure compiler
622+
# annotations from the source code and we no longer need to worry about generating closure
623+
# friendly code.
624+
# This means all the calls to acorn_optimizer that come after this will now run without
625+
# --closure-friendly
626+
settings.MAYBE_CLOSURE_COMPILER = False
627+
621628
cmd = closure_cmd + args
622629
return run_closure_cmd(cmd, filename, env)
623630

tools/link.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,6 +2561,9 @@ def modularize():
25612561
shared.get_temp_files().note(final_js)
25622562
save_intermediate('modularized')
25632563

2564+
if settings.MINIFY_WHITESPACE:
2565+
final_js = building.acorn_optimizer(final_js, ['--minify-whitespace'])
2566+
25642567

25652568
def module_export_name_substitution():
25662569
assert not settings.MODULARIZE

0 commit comments

Comments
 (0)