Commit b69c38d
feat: Reduce build size by enabling
* chore: Format build_tasks.mjs
* feat: Enable `assume_function_wrapper` build flag
* refactor(build): Separate chunk exporter creation from compilation
Since the chunk export files are source files to Closure Compiler,
separate the creation of the former from the invocation of the
latter. Specifically:
- Rename writeChunkExportFiles to buildChunkExporters.
- Invoked as a separate task in the minify series, instead of
calling it directly from buildCompiled.
- Revert the changes to buildCompiled that made it an async
function just so it could call writeChunkExportFiles.
* refactor(build): Use a separate property for each chunk's exports
The existing code results in each chunk overwriting the same
well-known property ($.__chunkExports__). Since these properties
are only expected to be read once, in the same chunk's wrapper's
factory function, this isn't strictly wrong - but it made
understanding the minified bundles produced by PR #9912 a bit
confusing.
* cleanup(build): Minor naming improvements
* docs(build): Improve JSDocs + inline comments
Note that some comments have been deleted without replacement;
these made statements which are no longer true.
* cleanup(build): Reorder new chunk-exporters-related code
Reorder the new code that generates the chunk exporters, to put
it together with (but before) the code that generates the chunk
wrappers, since the two are closely coupled.
* fix(build): Rename chunk exporter's dir + filenames to "exporters"
For consistency with code and docs, call the files that contain code
which retrieves the chunks' export objects "chunk exporters", since
"chunk exports" better describes the objects being exported.
---------
Co-authored-by: Christopher Allen <cpcallen+git@google.com>assume_function_wrapper build flag (#9921)1 parent e22287e commit b69c38d
2 files changed
Lines changed: 264 additions & 111 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | | - | |
239 | 237 | | |
240 | 238 | | |
241 | 239 | | |
| |||
0 commit comments