Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling transpile method after modularising #22390

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -2098,6 +2098,16 @@ def phase_final_emitting(options, state, target, wasm_target):
elif settings.USE_CLOSURE_COMPILER:
module_export_name_substitution()

## from issue #22290, running tranpiler after modularize()
if final_js:
if settings.TRANSPILE:
with ToolchainProfiler.profile_block('transpile'):
final_js = building.transpile(final_js)
save_intermediate('transpile')
# Run acorn one more time to minify whitespace after babel runs
if settings.MINIFY_WHITESPACE:
final_js = building.acorn_optimizer(final_js, ['--minify-whitespace'])

# Run a final optimization pass to clean up items that were not possible to
# optimize by Closure, or unoptimalities that were left behind by processing
# steps that occurred after Closure.
Expand Down Expand Up @@ -2245,14 +2255,6 @@ def phase_binaryen(target, options, wasm_target):
final_js = building.closure_compiler(final_js, extra_closure_args=options.closure_args)
save_intermediate('closure')

if settings.TRANSPILE:
with ToolchainProfiler.profile_block('transpile'):
final_js = building.transpile(final_js)
save_intermediate('transpile')
# Run acorn one more time to minify whitespace after babel runs
if settings.MINIFY_WHITESPACE:
final_js = building.acorn_optimizer(final_js, ['--minify-whitespace'])

if settings.ASYNCIFY_LAZY_LOAD_CODE:
with ToolchainProfiler.profile_block('asyncify_lazy_load_code'):
building.asyncify_lazy_load_code(wasm_target, debug=intermediate_debug_info)
Expand Down
Loading