Home / Function/ transform() — react Function Reference

transform() — react Function Reference

Architecture documentation for the transform() function in ReactFreshBabelPlugin-test.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  9b2c14b1_4a29_07cf_f7ef_9d6081f59238["transform()"]
  f66dbdd3_ed66_6bcb_c540_c3542e50f2b0["ReactFreshBabelPlugin-test.js"]
  9b2c14b1_4a29_07cf_f7ef_9d6081f59238 -->|defined in| f66dbdd3_ed66_6bcb_c540_c3542e50f2b0
  style 9b2c14b1_4a29_07cf_f7ef_9d6081f59238 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-refresh/src/__tests__/ReactFreshBabelPlugin-test.js lines 14–37

function transform(input, options = {}) {
  return wrap(
    babel.transform(input, {
      babelrc: false,
      configFile: false,
      envName: options.envName,
      plugins: [
        '@babel/syntax-jsx',
        '@babel/syntax-dynamic-import',
        [
          freshPlugin,
          {
            skipEnvCheck:
              options.skipEnvCheck === undefined ? true : options.skipEnvCheck,
            // To simplify debugging tests:
            emitFullSignatures: true,
            ...options.freshOptions,
          },
        ],
        ...(options.plugins || []),
      ],
    }).code,
  );
}

Domain

Subdomains

Frequently Asked Questions

What does transform() do?
transform() is a function in the react codebase, defined in packages/react-refresh/src/__tests__/ReactFreshBabelPlugin-test.js.
Where is transform() defined?
transform() is defined in packages/react-refresh/src/__tests__/ReactFreshBabelPlugin-test.js at line 14.

Analyze Your Own Codebase

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

Try Supermodel Free