-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(build): Prepare UMD wrapper generation for transition to ES …
…modules (#5993) * fix(build): Correctly handle out-of-order chunks It turns out that closure-calculate-chunks does not guarantee that calculated chunks will be output in the same order as the entrypoints, so modify getChunkOptions so that it no longer makes that assumption. * refactor(build): Introduce NAMESPACE_PROPERTY; rename NAMESPACE_OBJECT Rename the constant NAMESPACE_OBJECT to NAMESPACE_VARIABLE to better explain its actual meaning, and introduce NAMESPACE_PROPERTY to specify what property the namespace object will be stored in (and change the previous value, "internal_", to "__namespace__" to reduce the chance of conflicts with properties created by the output of Closure Compiler). * refactor(build): Always save namespace object on chunk exports object This is so that chunks whose parent chunk is not the root chunk (chunks[0]) can obtain the namespace object. (See following commit.) * fix(build): Correct handling of chunk dependencies Previously getChunkOptions and chunkWrapper incorrectly assumed that a chunk could have more than one dependency. In fact, each chunk can have only a single dependency, which is its parent chunk. It is used only to retrieve the namespace object, which is saved on to the exports object for the chunk so that any child chunk(s) can obtain it. Update getChunkOptions and chunkWrapper (making the latter longer but more readable) accordingly. * refactor(build): Rename/repurpose chunk.exports -> .reexport And remove chunk.importAs, since it was no longer being used anywhere. * fix: remove unnecessary s from reexports Co-authored-by: alschmiedt <aschmiedt@google.com>
- Loading branch information
1 parent
243fc52
commit 9d62f92
Showing
1 changed file
with
87 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters