Repository navigation
Commit 6357e82
committed
feat(DefinePlugin): resolve an async runtimeValue before parsing
An async runtimeValue generator (or a promise-returning one with
`async: true`) now resolves in NormalModule's beforeParse hook, before
the parser needs it, and is served synchronously at parse time. The
synchronous path is unchanged. A promise returned without `async` throws
a clear error instead of emitting broken code. The beforeParse hook
becomes an AsyncSeriesHook; existing synchronous taps keep working.
closes #166291 parent d7e0fd9 commit 6357e82
36 files changed
Lines changed: 905 additions & 57 deletions
File tree
- .changeset
- lib
- test
- configCases/plugins
- define-plugin-async-runtime-value-error
- define-plugin-async-runtime-value-references
- define-plugin-async-runtime-value
- define-plugin-runtime-value-not-async
- watchCases/plugins/define-plugin-async-runtime-value
- 0
- 1
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments