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

Function main

packages/react-devtools-extensions/build.js:157–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155const SUPPORTED_BUILDS = ['chrome', 'firefox', 'edge'];
156
157const main = async buildId => {
158 if (!SUPPORTED_BUILDS.includes(buildId)) {
159 throw new Error(
160 `Unexpected build id - "${buildId}". Use one of ${JSON.stringify(
161 SUPPORTED_BUILDS,
162 )}.`,
163 );
164 }
165
166 const root = join(__dirname, buildId);
167 const manifestPath = join(root, 'manifest.json');
168 const destinationPath = join(root, 'build');
169
170 const envExtension = {
171 IS_CHROME: buildId === 'chrome',
172 IS_FIREFOX: buildId === 'firefox',
173 IS_EDGE: buildId === 'edge',
174 };
175
176 try {
177 const tempPath = join(__dirname, 'build', buildId);
178 await ensureLocalBuild();
179 await preProcess(destinationPath, tempPath);
180 const webpackStatsFilePath = await build(
181 tempPath,
182 manifestPath,
183 envExtension,
184 );
185
186 const builtUnpackedPath = join(destinationPath, 'unpacked');
187 await postProcess(tempPath, destinationPath, webpackStatsFilePath);
188
189 return builtUnpackedPath;
190 } catch (error) {
191 console.error(error);
192 process.exit(1);
193 }
194
195 return null;
196};
197
198module.exports = main;

Callers

nothing calls this directly

Calls 6

ensureLocalBuildFunction · 0.85
preProcessFunction · 0.85
postProcessFunction · 0.85
exitMethod · 0.80
buildFunction · 0.70
errorMethod · 0.65

Tested by

no test coverage detected