Home / File/ build.mjs — react Source File

build.mjs — react Source File

Architecture documentation for build.mjs, a javascript file in the react codebase. 6 imports, 0 dependents.

File javascript BabelCompiler Validation 6 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  cb6f354e_2376_05bf_7c22_9b78bef9a9fc["build.mjs"]
  5484aafd_f24c_2baf_6ad6_48c3d4e418a9["server.mjs"]
  cb6f354e_2376_05bf_7c22_9b78bef9a9fc --> 5484aafd_f24c_2baf_6ad6_48c3d4e418a9
  c94ad723_daef_e5a6_39f8_f0461ed20cda["client.mjs"]
  cb6f354e_2376_05bf_7c22_9b78bef9a9fc --> c94ad723_daef_e5a6_39f8_f0461ed20cda
  57427e70_64db_12c6_0a25_20c9374762fe["esbuild"]
  cb6f354e_2376_05bf_7c22_9b78bef9a9fc --> 57427e70_64db_12c6_0a25_20c9374762fe
  d1bf986d_109d_06f7_5c01_8c86cbcca1aa["yargs"]
  cb6f354e_2376_05bf_7c22_9b78bef9a9fc --> d1bf986d_109d_06f7_5c01_8c86cbcca1aa
  b402a0fc_00db_e86d_b1ea_ad4f8e9faaca["path"]
  cb6f354e_2376_05bf_7c22_9b78bef9a9fc --> b402a0fc_00db_e86d_b1ea_ad4f8e9faaca
  f1eacfc5_abd5_28ac_35ad_cf5f65bdf7b7["url"]
  cb6f354e_2376_05bf_7c22_9b78bef9a9fc --> f1eacfc5_abd5_28ac_35ad_cf5f65bdf7b7
  style cb6f354e_2376_05bf_7c22_9b78bef9a9fc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

#!/usr/bin/env node

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

import * as esbuild from 'esbuild';
import yargs from 'yargs';
import * as Server from './server.mjs';
import * as Client from './client.mjs';
import path from 'path';
import {fileURLToPath} from 'url';

const IS_DEV = process.env.NODE_ENV === 'development';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const argv = yargs(process.argv.slice(2))
  .choices('t', ['client', 'server'])
  .options('w', {
    alias: 'watch',
    default: false,
    type: 'boolean',
  })
  .parse();

async function main() {
  if (argv.w) {
    const serverCtx = await esbuild.context(Server.config);
    const clientCtx = await esbuild.context(Client.config);
    await Promise.all([serverCtx.watch(), clientCtx.watch()]);
    console.log('watching for changes...');
  } else {
    switch (argv.t) {
      case 'server': {
        await esbuild.build({
          sourcemap: IS_DEV,
          minify: IS_DEV === false,
          ...Server.config,
        });
        break;
      }
      case 'client': {
        await esbuild.build({
          sourcemap: IS_DEV,
          minify: IS_DEV === false,
          ...Client.config,
        });
        break;
      }
    }
  }
}

main();

Domain

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does build.mjs do?
build.mjs is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in build.mjs?
build.mjs defines 1 function(s): main.
What does build.mjs depend on?
build.mjs imports 6 module(s): client.mjs, esbuild, path, server.mjs, url, yargs.
Where is build.mjs in the architecture?
build.mjs is located at compiler/packages/react-forgive/scripts/build.mjs (domain: BabelCompiler, subdomain: Validation, directory: compiler/packages/react-forgive/scripts).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free