File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,22 +149,11 @@ function getNodeModuleData(module: Webpack.Module): NodeModule.Data | null {
149149 return null ;
150150 }
151151
152- function cleanWindowsPaths ( paths : RegExpMatchArray | null ) {
153- var out : string [ ] = [ ] ;
154- if ( ! paths ) {
155- return out ;
156- }
157- for ( var i = 0 ; i < paths . length ; i += 1 ) {
158- out [ i ] = paths [ i ] . replace ( ':' , '' ) . split ( '\\' ) . join ( '/' ) ;
159- }
160- return out ;
161- }
162-
163152 // Note that the negative lookahead (?!.*node_modules) ensures that we only match the last node_modules/ folder in the path,
164153 // in case the package was located in a sub-node_modules (which can occur in special circumstances).
165154 // We also need to take care of scoped modules. If the name starts with @ we must keep two parts,
166155 // so @corp /bar is the proper module name.
167- const modulePaths = cleanWindowsPaths ( module . resource . match ( / ( .* \b n o d e _ m o d u l e s [ \\ / ] (? ! .* \b n o d e _ m o d u l e s \b ) ( (?: @ [ ^ \\ / ] + [ \\ / ] ) ? [ ^ \\ / ] + ) ) ( .* ) / i) ) ;
156+ const modulePaths = module . resource . match ( / ( .* \b n o d e _ m o d u l e s [ \\ / ] (? ! .* \b n o d e _ m o d u l e s \b ) ( (?: @ [ ^ \\ / ] + [ \\ / ] ) ? [ ^ \\ / ] + ) ) ( .* ) / i) ;
168157 if ( ! modulePaths || modulePaths . length !== 4 ) {
169158 return null ;
170159 }
You can’t perform that action at this time.
0 commit comments