-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 (#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 vercel/next.js#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 vercel/next.js#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/강동윤 <kdy1997.dev@gmail.com>
- Loading branch information
1 parent
a44f3f3
commit 9004d1b
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