-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option for inlining typeof window (vercel/turborepo#8211)
### Description In Next.js with webpack we have a feature to inline `typeof window` in server/client environments. That allows e.g. ``` "use client" if(typeof window === 'undefined') { import('server-only-package') } ``` Today with Turbopack above code causes `server-only-package` to still be loaded in the browser compilation. Which causes issues like #66058 where the `if`/`else` condition is used to use different modules for server and client. This change is required to pass the test in #66058 Pushing up the Next.js changes in that PR. <!-- ✍️ Write a short summary of your work. If necessary, include relevant screenshots. --> ### Testing Instructions <!-- Give a quick description of steps to test your changes. --> --------- Co-authored-by: Donny/강동윤 <[email protected]>
- Loading branch information
1 parent
a25cd17
commit 759ef9c
Showing
4 changed files
with
36 additions
and
1 deletion.
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