MCPcopy Index your code
hub / github.com/react/react / main

Function main

packages/react-devtools-extensions/chrome/build.js:12–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10const build = require('../build');
11
12const main = async () => {
13 const {crx, keyPath} = argv;
14
15 if (crx) {
16 if (!keyPath || !existsSync(keyPath)) {
17 console.error('Must specify a key file (.pem) to build CRX');
18 process.exit(1);
19 }
20 }
21
22 await build('chrome');
23
24 if (crx) {
25 const cwd = join(__dirname, 'build');
26
27 let safeKeyPath = keyPath;
28 if (!isAbsolute(keyPath)) {
29 safeKeyPath = join(relative(cwd, process.cwd()), keyPath);
30 }
31
32 const crxPath = join(
33 __dirname,
34 '..',
35 '..',
36 '..',
37 'node_modules',
38 '.bin',
39 'crx'
40 );
41
42 execSync(
43 `${crxPath} pack ./unpacked -o ReactDevTools.crx -p ${safeKeyPath}`,
44 {
45 cwd,
46 }
47 );
48 }
49
50 console.log(chalk.green('\nThe Chrome extension has been built!'));
51 console.log(chalk.green('You can test this build by running:'));
52 console.log(chalk.gray('\n# From the react-devtools root directory:'));
53 console.log('yarn run test:chrome');
54};
55
56main();

Callers 1

build.jsFile · 0.70

Calls 3

exitMethod · 0.80
errorMethod · 0.65
buildFunction · 0.50

Tested by

no test coverage detected