Skip to content

Commit 6656273

Browse files
author
Juan Tejada
committed
Keep build changes
1 parent 3aec2aa commit 6656273

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

packages/react-devtools-extensions/build.js

+11
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,17 @@ const build = async (tempPath, manifestPath) => {
102102
}
103103
manifest.description += `\n\nCreated from revision ${commit} on ${dateString}.`;
104104

105+
if (process.env.NODE_ENV === 'development') {
106+
// When building the local development version of the
107+
// extension we want to be able to have a stable extension ID
108+
// for the local build (in order to be able to reliably detect
109+
// duplicate installations of DevTools).
110+
// By specifying a key in the built manifest.json file,
111+
// we can make it so the generated extension ID is stable.
112+
// For more details see the docs here: https://developer.chrome.com/docs/extensions/mv2/manifest/key/
113+
manifest.key = 'reactdevtoolslocalbuilduniquekey';
114+
}
115+
105116
writeFileSync(copiedManifestPath, JSON.stringify(manifest, null, 2));
106117

107118
// Pack the extension

packages/react-devtools-extensions/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
"private": true,
55
"scripts": {
66
"build": "cross-env NODE_ENV=production yarn run build:chrome && yarn run build:firefox && yarn run build:edge",
7-
"build:dev": "cross-env NODE_ENV=development yarn run build:chrome:dev && yarn run build:firefox:dev && yarn run build:edge:dev",
7+
"build:local": "cross-env NODE_ENV=development yarn run build:chrome:dev && yarn run build:firefox:dev && yarn run build:edge:dev",
88
"build:chrome": "cross-env NODE_ENV=production node ./chrome/build",
99
"build:chrome:fb": "cross-env NODE_ENV=production FEATURE_FLAG_TARGET=extension-fb node ./chrome/build --crx",
10-
"build:chrome:dev": "cross-env NODE_ENV=development node ./chrome/build",
10+
"build:chrome:local": "cross-env NODE_ENV=development node ./chrome/build",
1111
"build:firefox": "cross-env NODE_ENV=production node ./firefox/build",
12-
"build:firefox:dev": "cross-env NODE_ENV=development node ./firefox/build",
12+
"build:firefox:local": "cross-env NODE_ENV=development node ./firefox/build",
1313
"build:edge": "cross-env NODE_ENV=production node ./edge/build",
1414
"build:edge:fb": "cross-env NODE_ENV=production FEATURE_FLAG_TARGET=extension-fb node ./edge/build --crx",
15-
"build:edge:dev": "cross-env NODE_ENV=development node ./edge/build",
15+
"build:edge:local": "cross-env NODE_ENV=development node ./edge/build",
1616
"test:chrome": "node ./chrome/test",
1717
"test:firefox": "node ./firefox/test",
1818
"test:edge": "node ./edge/test",

packages/react-devtools/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Some changes requiring testing in the browser extension (e.g. like "named hooks"
5757
```sh
5858
cd <react-repo>
5959
cd packages/react-devtools-extensions
60-
yarn build:chrome && yarn test:chrome
60+
yarn build:chrome:local && yarn test:chrome
6161
```
6262
This will launch a standalone version of Chrome with the locally built React DevTools pre-installed. If you are testing a specific URL, you can make your testing even faster by passing the `--url` argument to the test script:
6363
```sh

0 commit comments

Comments
 (0)