File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
packages/next/src/build/webpack/plugins Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,13 @@ function defaultIsSourceMapAsset(name: string): boolean {
31
31
return name . endsWith ( '.map' )
32
32
}
33
33
34
+ function isWebpackRuntimeModule ( modulePath : string ) : boolean {
35
+ // webpack:///webpack/bootstrap
36
+ // webpack://_N_E/webpack/
37
+ // webpack://someOtherLibrary/webpack/
38
+ return / ^ w e b p a c k : \/ \/ ( [ ^ / ] * ) \/ w e b p a c k / . test ( modulePath )
39
+ }
40
+
34
41
/**
35
42
* This plugin adds a field to source maps that identifies which sources are
36
43
* vendored or runtime-injected (aka third-party) sources. These are consumed by
@@ -77,6 +84,10 @@ export default class DevToolsIgnorePlugin {
77
84
for ( const [ index , path ] of sourcemap . sources . entries ( ) ) {
78
85
if ( this . options . shouldIgnorePath ( path ) ) {
79
86
ignoreList . push ( index )
87
+ } else if ( isWebpackRuntimeModule ( path ) ) {
88
+ // Just like our EvalSourceMapDevToolPlugin ignore-lists Webpack
89
+ // runtime by default, we do the same here.
90
+ ignoreList . push ( index )
80
91
}
81
92
}
82
93
You can’t perform that action at this time.
0 commit comments