Skip to content

Commit

Permalink
Change ReactVersion from CJS to ES module
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Feb 28, 2020
1 parent 4ee592e commit d3e5760
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 1 addition & 3 deletions packages/shared/ReactVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@
* LICENSE file in the root directory of this source tree.
*/

'use strict';

// TODO: this is special because it gets imported during build.
module.exports = '16.13.0';
export default '16.13.0';
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const run = async ({cwd, packages, skipPackages, tags}) => {
const sourceReactVersion = readFileSync(
sourceReactVersionPath,
'utf8'
).replace(/module\.exports = '[^']+';/, `module.exports = '${version}';`);
).replace(/export default '[^']+';/, `export default '${version}';`);
writeFileSync(sourceReactVersionPath, sourceReactVersion);
}
};
Expand Down
5 changes: 1 addition & 4 deletions scripts/release/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,7 @@ const updateVersionsForNext = async (cwd, reactVersion, version) => {
const sourceReactVersion = readFileSync(
sourceReactVersionPath,
'utf8'
).replace(
/module\.exports = '[^']+';/,
`module.exports = '${reactVersion}';`
);
).replace(/export default '[^']+';/, `export default '${reactVersion}';`);
writeFileSync(sourceReactVersionPath, sourceReactVersion);

// Update the root package.json.
Expand Down

0 comments on commit d3e5760

Please sign in to comment.