@@ -158,16 +158,18 @@ function processStable(buildDir) {
158
158
}
159
159
160
160
if ( fs . existsSync ( buildDir + '/facebook-www' ) ) {
161
+ const hash = crypto . createHash ( 'sha1' ) ;
161
162
for ( const fileName of fs . readdirSync ( buildDir + '/facebook-www' ) . sort ( ) ) {
162
163
const filePath = buildDir + '/facebook-www/' + fileName ;
163
164
const stats = fs . statSync ( filePath ) ;
164
165
if ( ! stats . isDirectory ( ) ) {
166
+ hash . update ( fs . readFileSync ( filePath ) ) ;
165
167
fs . renameSync ( filePath , filePath . replace ( '.js' , '.classic.js' ) ) ;
166
168
}
167
169
}
168
170
updatePlaceholderReactVersionInCompiledArtifacts (
169
171
buildDir + '/facebook-www' ,
170
- ReactVersion + '-www-classic-%FILEHASH%'
172
+ ReactVersion + '-www-classic-' + hash . digest ( 'hex' ) . slice ( 0 , 8 )
171
173
) ;
172
174
}
173
175
@@ -222,16 +224,18 @@ function processExperimental(buildDir, version) {
222
224
}
223
225
224
226
if ( fs . existsSync ( buildDir + '/facebook-www' ) ) {
227
+ const hash = crypto . createHash ( 'sha1' ) ;
225
228
for ( const fileName of fs . readdirSync ( buildDir + '/facebook-www' ) . sort ( ) ) {
226
229
const filePath = buildDir + '/facebook-www/' + fileName ;
227
230
const stats = fs . statSync ( filePath ) ;
228
231
if ( ! stats . isDirectory ( ) ) {
232
+ hash . update ( fs . readFileSync ( filePath ) ) ;
229
233
fs . renameSync ( filePath , filePath . replace ( '.js' , '.modern.js' ) ) ;
230
234
}
231
235
}
232
236
updatePlaceholderReactVersionInCompiledArtifacts (
233
237
buildDir + '/facebook-www' ,
234
- ReactVersion + '-www-modern-%FILEHASH%'
238
+ ReactVersion + '-www-modern-' + hash . digest ( 'hex' ) . slice ( 0 , 8 )
235
239
) ;
236
240
}
237
241
0 commit comments