@@ -147,15 +147,15 @@ function evalDependencyGraph({loaderContext, src, filename, publicPath = ""}) {
147
147
return exports ;
148
148
}
149
149
150
- const rndPlaceholder = "__EXTRACT_LOADER_PLACEHOLDER__" + rndNumber ( ) + rndNumber ( ) ;
150
+ const extractPlaceholder = "__EXTRACT_LOADER_PLACEHOLDER__" + counterNumber ( ) + "__" ;
151
151
152
152
newDependencies . push ( {
153
153
absolutePath,
154
154
absoluteRequest : loaders + absolutePath + query ,
155
- rndPlaceholder ,
155
+ extractPlaceholder ,
156
156
} ) ;
157
157
158
- return rndPlaceholder ;
158
+ return extractPlaceholder ;
159
159
} ,
160
160
} ) ;
161
161
@@ -170,7 +170,7 @@ function evalDependencyGraph({loaderContext, src, filename, publicPath = ""}) {
170
170
) ;
171
171
const contentWithPlaceholders = extractExports ( sandbox . module . exports ) ;
172
172
const extractedContent = extractedDependencyContent . reduce ( ( content , dependencyContent , idx ) => {
173
- const pattern = new RegExp ( newDependencies [ idx ] . rndPlaceholder , "g" ) ;
173
+ const pattern = new RegExp ( newDependencies [ idx ] . extractPlaceholder , "g" ) ;
174
174
175
175
return content . replace ( pattern , dependencyContent ) ;
176
176
} , contentWithPlaceholders ) ;
@@ -183,13 +183,13 @@ function evalDependencyGraph({loaderContext, src, filename, publicPath = ""}) {
183
183
return evalModule ( src , filename ) ;
184
184
}
185
185
186
+ let counter = 0 ;
187
+
186
188
/**
187
189
* @returns {string }
188
190
*/
189
- function rndNumber ( ) {
190
- return Math . random ( )
191
- . toString ( )
192
- . slice ( 2 ) ;
191
+ function counterNumber ( ) {
192
+ return ( counter ++ ) . toString ( 10 ) ;
193
193
}
194
194
195
195
// getPublicPath() encapsulates the complexity of reading the publicPath from the current
0 commit comments