Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions packages/react-devtools-extensions/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ function getGitCommit() {
}
}

function getVersionString() {
const packageVersion = JSON.parse(
readFileSync(
resolve(__dirname, '..', 'react-devtools-core', './package.json'),
),
).version;
function getVersionString(packageVersion = null) {
if (packageVersion == null) {
packageVersion = JSON.parse(
readFileSync(
resolve(__dirname, '..', 'react-devtools-core', './package.json'),
),
).version;
}

const commit = getGitCommit();

Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/webpack.backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const builtModulesDir = resolve(

const __DEV__ = NODE_ENV === 'development';

const DEVTOOLS_VERSION = getVersionString();
const DEVTOOLS_VERSION = getVersionString(process.env.DEVTOOLS_VERSION);

const featureFlagTarget = process.env.FEATURE_FLAG_TARGET || 'extension-oss';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const builtModulesDir = resolve(

const __DEV__ = NODE_ENV === 'development';

const DEVTOOLS_VERSION = getVersionString();
const DEVTOOLS_VERSION = getVersionString(process.env.DEVTOOLS_VERSION);

const LOGGING_URL = process.env.LOGGING_URL || null;

Expand Down