-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22697 from storybookjs/fix/nextjs-node-polyfills
Next.js: add compatibility with Next 13.4.3
- Loading branch information
Showing
4 changed files
with
570 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { Configuration } from 'webpack'; | ||
import NodePolyfillPlugin from 'node-polyfill-webpack-plugin'; | ||
|
||
export const configureNodePolyfills = (baseConfig: Configuration) => { | ||
// This is added as a way to avoid issues caused by Next.js 13.4.3 | ||
// introduced by gzip-size | ||
baseConfig.plugins = [...(baseConfig.plugins || []), new NodePolyfillPlugin()]; | ||
|
||
baseConfig.resolve = { | ||
...baseConfig.resolve, | ||
fallback: { | ||
fs: false, | ||
}, | ||
}; | ||
|
||
return baseConfig; | ||
}; |
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.