feat(nextjs): add migration for Next.js 13.3.0 (#16370)

This commit is contained in:
Jack Hsu 2023-04-18 10:26:23 -04:00 committed by GitHub
parent a7bc1c6635
commit ced3ab9c59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -307,6 +307,15 @@
"alwaysAddToPackageJson": false "alwaysAddToPackageJson": false
} }
} }
},
"16.0.0": {
"version": "16.0.0-beta.0",
"packages": {
"next": {
"version": "13.3.0",
"alwaysAddToPackageJson": false
}
}
} }
} }
} }

View File

@ -116,6 +116,14 @@ export const webpack = async (
}, },
resolve: { resolve: {
...storybookWebpackConfig.resolve, ...storybookWebpackConfig.resolve,
fallback: {
...storybookWebpackConfig.resolve?.fallback,
// Next.js and other React frameworks may have server-code that uses these modules.
// They are not meant for client-side components so skip the fallbacks.
assert: false,
path: false,
util: false,
},
plugins: mergePlugins( plugins: mergePlugins(
...((storybookWebpackConfig.resolve.plugins ?? ...((storybookWebpackConfig.resolve.plugins ??
[]) as ResolvePluginInstance[]), []) as ResolvePluginInstance[]),