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(
106
106
107
107
// Prevent `@vercel/nft` (which nextjs uses to determine which files are needed when packaging up a lambda) from
108
108
// 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.
110
111
const nftPlugin = newConfig . plugins ?. find ( ( plugin : WebpackPluginInstance ) => {
111
112
const proto = Object . getPrototypeOf ( plugin ) as WebpackPluginInstance ;
112
113
return proto . constructor . name === 'TraceEntryPointsPlugin' ;
113
114
} ) as WebpackPluginInstance & { excludeFiles : string [ ] } ;
114
115
if ( nftPlugin ) {
115
116
if ( Array . isArray ( nftPlugin . excludeFiles ) ) {
116
- nftPlugin . excludeFiles . push ( path . join ( __dirname , 'withSentryConfig.js' ) ) ;
117
+ nftPlugin . excludeFiles . push ( __filename ) ;
117
118
} else {
118
119
__DEBUG_BUILD__ &&
119
120
logger . warn (
You can’t perform that action at this time.
0 commit comments