Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hook for dynamic entry chunk emission (#2809)
* Merge compact and non-compact import.meta.url mechanisms * Extract more common code * Add option to configure import.meta.url resolution * Extract more common code * Switch to using a plugin hook * Move functionality into default plugin * Improve SystemJS handling * Refactor import.meta.url handling * Fix, refactor and test asset emission * Extract ModuleLoader * Use sets for colouring hashes * Simplify alias generation * Attach aliases to modules * Transform loading into a process that dynamically accepts new entry points and manual chunks * Pass alias objects through the module loader * Implement basic chunk emission * Allow duplicate entry points again * Rename addEntry -> emitEntryChunk * Simplify alias handling by immediately assigning a chunkAlias to entry points and introducing a manualChunkAlias for colouring to resolve this confusing double use of chunkAlias * * Allow manual chunks to contain nested entry points * Allow manual chunks to contain entry points without name or with the same name * Throw if an emitted chunk is not found * Throw if there is a conflict between manual chunk entries * Allow nesting of manual chunks without requiring a specific order * Manual chunks never conflict with entry points: - if the alias matches, the manual chunk becomes the entry chunk - otherwise a facade is created * Return correct file name if a facade is created for an emitted chunk * Start using central error handlers * Improve plugin driver type, add generic resolveFileUrl hook * Test new resolveFileUrl hook, make meta properties tree-shakeable * Move setAssetSource failure tests to function * Test and extract all errors thrown when emitting assets * Extract and refine error when chunk id cannot be found * Fail if filename is not yet available * Fail when adding a chunk after loading has finished * Do not access process.cwd() unchecked * Move isExternal to module loader * Fix typing of resolveId context hook * Refine worker test * Revert to "wrong" resolveId type as this will probably be fixed in a separate PR * Suppress .js extensions for AMD, fix issue with empty dynamically imported chunks * Use generated chunk naming scheme for emitted chunks and rename context function to `emitChunk` * Allow emitted chunks to be named * Add paint worklet example * Update documentation * Add reference ids to resolveFileUrl and replace type * Do not require `input` to be set if a dynamic entry is emitted * Use facade module id as [name] for dynamic imports
- Loading branch information
1 parent
980903b
commit 18829da
Showing
644 changed files
with
3,752 additions
and
1,126 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
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
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
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
Oops, something went wrong.