Home / Function/ findLicenseFile() — vite Function Reference

findLicenseFile() — vite Function Reference

Architecture documentation for the findLicenseFile() function in license.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  8b9bb404_07c6_e43e_c1c2_b74b7e73b0b7["findLicenseFile()"]
  82f800f1_6da8_8cca_d4a5_6dbc08ca3747["license.ts"]
  8b9bb404_07c6_e43e_c1c2_b74b7e73b0b7 -->|defined in| 82f800f1_6da8_8cca_d4a5_6dbc08ca3747
  481d1103_be94_cde4_36c2_68b3faf11385["licensePlugin()"]
  481d1103_be94_cde4_36c2_68b3faf11385 -->|calls| 8b9bb404_07c6_e43e_c1c2_b74b7e73b0b7
  style 8b9bb404_07c6_e43e_c1c2_b74b7e73b0b7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/plugins/license.ts lines 142–150

function findLicenseFile(pkgDir: string) {
  const files = fs.readdirSync(pkgDir)
  const matchedFile = files.find((file) =>
    licenseFiles.some((re) => re.test(file)),
  )
  if (matchedFile) {
    return path.join(pkgDir, matchedFile)
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does findLicenseFile() do?
findLicenseFile() is a function in the vite codebase, defined in packages/vite/src/node/plugins/license.ts.
Where is findLicenseFile() defined?
findLicenseFile() is defined in packages/vite/src/node/plugins/license.ts at line 142.
What calls findLicenseFile()?
findLicenseFile() is called by 1 function(s): licensePlugin.

Analyze Your Own Codebase

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

Try Supermodel Free