Home / Function/ extractImportPaths() — vite Function Reference

extractImportPaths() — vite Function Reference

Architecture documentation for the extractImportPaths() function in scan.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  7df81f3b_6fcf_3c38_e4eb_a447f9d9da7f["extractImportPaths()"]
  6c7a7f5e_5d30_3576_49bf_9041362fd3fd["scan.ts"]
  7df81f3b_6fcf_3c38_e4eb_a447f9d9da7f -->|defined in| 6c7a7f5e_5d30_3576_49bf_9041362fd3fd
  01ea698c_723c_af06_e469_c7d7c469b6bb["rolldownScanPlugin()"]
  01ea698c_723c_af06_e469_c7d7c469b6bb -->|calls| 7df81f3b_6fcf_3c38_e4eb_a447f9d9da7f
  style 7df81f3b_6fcf_3c38_e4eb_a447f9d9da7f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/optimizer/scan.ts lines 726–739

function extractImportPaths(code: string) {
  // empty singleline & multiline comments to avoid matching comments
  code = code
    .replace(multilineCommentsRE, '/* */')
    .replace(singlelineCommentsRE, '')

  let js = ''
  let m
  importsRE.lastIndex = 0
  while ((m = importsRE.exec(code)) != null) {
    js += `\nimport ${m[1]}`
  }
  return js
}

Subdomains

Frequently Asked Questions

What does extractImportPaths() do?
extractImportPaths() is a function in the vite codebase, defined in packages/vite/src/node/optimizer/scan.ts.
Where is extractImportPaths() defined?
extractImportPaths() is defined in packages/vite/src/node/optimizer/scan.ts at line 726.
What calls extractImportPaths()?
extractImportPaths() is called by 1 function(s): rolldownScanPlugin.

Analyze Your Own Codebase

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

Try Supermodel Free