Home / Function/ exportAll() — vite Function Reference

exportAll() — vite Function Reference

Architecture documentation for the exportAll() function in runner.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  68cc8eb1_65b1_d39b_493d_786828281dad["exportAll()"]
  29e248d2_9983_1037_00e6_8bcd9ee87840["runner.ts"]
  68cc8eb1_65b1_d39b_493d_786828281dad -->|defined in| 29e248d2_9983_1037_00e6_8bcd9ee87840
  2299eb48_afeb_b0e8_8b25_f24d005c00d4["directRequest()"]
  2299eb48_afeb_b0e8_8b25_f24d005c00d4 -->|calls| 68cc8eb1_65b1_d39b_493d_786828281dad
  0dc7ee1e_8a3c_61b7_f7a8_7cc4dc085f43["isPrimitive()"]
  68cc8eb1_65b1_d39b_493d_786828281dad -->|calls| 0dc7ee1e_8a3c_61b7_f7a8_7cc4dc085f43
  style 68cc8eb1_65b1_d39b_493d_786828281dad fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/module-runner/runner.ts lines 431–454

function exportAll(exports: any, sourceModule: any) {
  // when a module exports itself it causes
  // call stack error
  if (exports === sourceModule) return

  if (
    isPrimitive(sourceModule) ||
    Array.isArray(sourceModule) ||
    sourceModule instanceof Promise
  )
    return

  for (const key in sourceModule) {
    if (key !== 'default' && key !== '__esModule' && !(key in exports)) {
      try {
        Object.defineProperty(exports, key, {
          enumerable: true,
          configurable: true,
          get: () => sourceModule[key],
        })
      } catch {}
    }
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does exportAll() do?
exportAll() is a function in the vite codebase, defined in packages/vite/src/module-runner/runner.ts.
Where is exportAll() defined?
exportAll() is defined in packages/vite/src/module-runner/runner.ts at line 431.
What does exportAll() call?
exportAll() calls 1 function(s): isPrimitive.
What calls exportAll()?
exportAll() is called by 1 function(s): directRequest.

Analyze Your Own Codebase

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

Try Supermodel Free