add turbopack resolveAlias fs fallback for nextjs 16 (#58390)
This commit is contained in:
3
empty.ts
Normal file
3
empty.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
// Empty module to satisfy Turbopack resolveAlias fallback for Node.js modules
|
||||
// See turbopack config in next.config.ts
|
||||
export default {}
|
||||
@@ -47,9 +47,21 @@ const config: NextConfig = {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// Turbopack is the default bundler in Next.js 16
|
||||
// Keep webpack config for now to support both bundlers
|
||||
turbopack: {},
|
||||
|
||||
// Turbopack configuration for Next.js 16 (replaces webpack fallbacks)
|
||||
turbopack: {
|
||||
resolveAlias: {
|
||||
fs: {
|
||||
browser: './empty.ts', // Point to empty module when fs is requested for browser
|
||||
},
|
||||
async_hooks: {
|
||||
browser: './empty.ts', // Point to empty module when async_hooks is requested for browser
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
webpack: (webpackConfig) => {
|
||||
webpackConfig.experiments = webpackConfig.experiments || {}
|
||||
|
||||
Reference in New Issue
Block a user