Skip to content

Commit 6357e82

Browse files
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 #16629
1 parent d7e0fd9 commit 6357e82

36 files changed

Lines changed: 905 additions & 57 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack": minor
3+
---
4+
5+
Let `DefinePlugin.runtimeValue` compute a define asynchronously.

0 commit comments

Comments
 (0)