diff --git a/scripts/rollup/build-all-release-channels.js b/scripts/rollup/build-all-release-channels.js index aef28341746..13ac464c7ba 100644 --- a/scripts/rollup/build-all-release-channels.js +++ b/scripts/rollup/build-all-release-channels.js @@ -167,10 +167,14 @@ function processStable(buildDir) { fs.renameSync(filePath, filePath.replace('.js', '.classic.js')); } } + const versionString = + ReactVersion + '-www-classic-' + sha + '-' + dateString; updatePlaceholderReactVersionInCompiledArtifacts( buildDir + '/facebook-www', - ReactVersion + '-www-classic-' + sha + '-' + dateString + versionString ); + // Also save a file with the version number + fs.writeFileSync(buildDir + '/facebook-www/VERSION_CLASSIC', versionString); } if (fs.existsSync(buildDir + '/sizes')) { @@ -213,9 +217,28 @@ function processExperimental(buildDir, version) { fs.renameSync(filePath, filePath.replace('.js', '.modern.js')); } } + const versionString = + ReactVersion + '-www-modern-' + sha + '-' + dateString; updatePlaceholderReactVersionInCompiledArtifacts( buildDir + '/facebook-www', - ReactVersion + '-www-modern-' + sha + '-' + dateString + versionString + ); + + // Also save a file with the version number + fs.writeFileSync(buildDir + '/facebook-www/VERSION_MODERN', versionString); + } + + if (fs.existsSync(buildDir + '/facebook-react-native')) { + const versionString = ReactVersion + '-native-fb-' + sha + '-' + dateString; + updatePlaceholderReactVersionInCompiledArtifacts( + buildDir + '/facebook-react-native', + versionString + ); + + // Also save a file with the version number + fs.writeFileSync( + buildDir + '/facebook-react-native/VERSION_NATIVE_FB', + versionString ); }