File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
packages/nextjs/src/config Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -106,14 +106,15 @@ export function constructWebpackConfigFunction(
106106
107107 // Prevent `@vercel/nft` (which nextjs uses to determine which files are needed when packaging up a lambda) from
108108 // including any of our build-time code or dependencies. (Otherwise it'll include files like this one and even the
109- // entirety of rollup and sucrase.)
109+ // entirety of rollup and sucrase.) Since this file is the root of that dependency tree, it's enough to just
110+ // exclude it and the rest will be excluded as well.
110111 const nftPlugin = newConfig . plugins ?. find ( ( plugin : WebpackPluginInstance ) => {
111112 const proto = Object . getPrototypeOf ( plugin ) as WebpackPluginInstance ;
112113 return proto . constructor . name === 'TraceEntryPointsPlugin' ;
113114 } ) as WebpackPluginInstance & { excludeFiles : string [ ] } ;
114115 if ( nftPlugin ) {
115116 if ( Array . isArray ( nftPlugin . excludeFiles ) ) {
116- nftPlugin . excludeFiles . push ( path . join ( __dirname , 'withSentryConfig.js' ) ) ;
117+ nftPlugin . excludeFiles . push ( __filename ) ;
117118 } else {
118119 __DEBUG_BUILD__ &&
119120 logger . warn (
You can’t perform that action at this time.
0 commit comments