Support async evaluation for compiler hooks
See original GitHub issueFeature request
Add a new async compiler hook at the beginning of compiler initialization, or turn most of sync hooks like entryOption
to async.
What is the expected behavior? A plugin should be able to perform asynchronous tasks at any hooks specially at compiler initialization and configuration.
What is motivation or use case for adding/changing the behavior?
There is some cases that plugin needs to evaluate for example new entries and this must be asynchronous, today this cannot be done as per all the hooks before, including entryOption
, are synchronous.
How should this be implemented in your opinion? Refactor related sync process to async.
Are you willing to work on this yourself? Yes.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Compiler Hooks | webpack
The Compiler supports watching which monitors the file system and recompiles ... Depending on the hook type, tapAsync and tapPromise may also be...
Read more >Change the webpack hook to use async tapPromises · Issue #9
I can create a PR to use a different async webpack hook that appears to ... async https://webpack.js.org/api/compiler-hooks/#afterplugins.
Read more >Performing Async Actions using Hooks - Level Up Coding
This simple hook gives us current state action to be performed and a function to perform the action. The body argument is in...
Read more >Testing asynchronous useEffect - Stack Overflow
I'm unit testing a hook but the principles should be the same if your async useEffect code is in a component. The problem....
Read more >Compiler - webpack 3 documentation
The Compiler supports "watch mode" which monitors the file system and recompiles ... This a reference guide to all the event hooks exposed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Compiler initialization need to stay sync. You can add async logic to determine entries. This is even supported without plugins:
You can use
https://github.com/webpack/webpack/blob/main/lib/index.js
, i.e.in your plugin and add entry dynamically