-
Notifications
You must be signed in to change notification settings - Fork 26.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support esm externals in app router (#65041)
### What Support `esmExternals` working in app router ### Why `esmExternals` was disabled for app router that most of the packages are picking up the CJS bundles for externals. This PR enables to resolve the ESM bundle for external packages. We have two issues discovered while enabling the flag, any esm external packages will fail in client page SSR and server action. We fixed them by changing the below bundling logics: * When a client page having a async dependency, we can await the page during in rendering * When a server action having a async dependency, we changed the server action entry creation with webpack along with the server client entry creation together, then webpack can handle the modules async propagation properly. Fixes #60756 Closes NEXT-2435 Closes NEXT-2472 Closes NEXT-3225 --------- Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
- Loading branch information
Showing
5 changed files
with
114 additions
and
146 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.