Home / Function/ applySourcemapIgnoreList() — vite Function Reference

applySourcemapIgnoreList() — vite Function Reference

Architecture documentation for the applySourcemapIgnoreList() function in sourcemap.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  4a3d733d_b16c_c3d4_b881_522470dd9957["applySourcemapIgnoreList()"]
  18244f7c_8357_ba88_c896_32c6447f1faf["sourcemap.ts"]
  4a3d733d_b16c_c3d4_b881_522470dd9957 -->|defined in| 18244f7c_8357_ba88_c896_32c6447f1faf
  13770e2a_c6d8_fb1f_6562_e66de7bc1deb["transformMiddleware()"]
  13770e2a_c6d8_fb1f_6562_e66de7bc1deb -->|calls| 4a3d733d_b16c_c3d4_b881_522470dd9957
  bdac5327_5085_933f_41df_0fc270134a38["loadAndTransform()"]
  bdac5327_5085_933f_41df_0fc270134a38 -->|calls| 4a3d733d_b16c_c3d4_b881_522470dd9957
  style 4a3d733d_b16c_c3d4_b881_522470dd9957 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/server/sourcemap.ts lines 111–150

export function applySourcemapIgnoreList(
  map: ExistingRawSourceMap,
  sourcemapPath: string,
  sourcemapIgnoreList: (sourcePath: string, sourcemapPath: string) => boolean,
  logger?: Logger,
): void {
  let { x_google_ignoreList } = map
  if (x_google_ignoreList === undefined) {
    x_google_ignoreList = []
  }
  if (map.sources) {
    for (
      let sourcesIndex = 0;
      sourcesIndex < map.sources.length;
      ++sourcesIndex
    ) {
      const sourcePath = map.sources[sourcesIndex]
      if (!sourcePath) continue

      const ignoreList = sourcemapIgnoreList(
        path.isAbsolute(sourcePath)
          ? sourcePath
          : path.resolve(path.dirname(sourcemapPath), sourcePath),
        sourcemapPath,
      )
      if (logger && typeof ignoreList !== 'boolean') {
        logger.warn('sourcemapIgnoreList function must return a boolean.')
      }

      if (ignoreList && !x_google_ignoreList.includes(sourcesIndex)) {
        x_google_ignoreList.push(sourcesIndex)
      }
    }

    if (x_google_ignoreList.length > 0) {
      if (!map.x_google_ignoreList)
        map.x_google_ignoreList = x_google_ignoreList
    }
  }
}

Domain

Subdomains

Frequently Asked Questions

What does applySourcemapIgnoreList() do?
applySourcemapIgnoreList() is a function in the vite codebase, defined in packages/vite/src/node/server/sourcemap.ts.
Where is applySourcemapIgnoreList() defined?
applySourcemapIgnoreList() is defined in packages/vite/src/node/server/sourcemap.ts at line 111.
What calls applySourcemapIgnoreList()?
applySourcemapIgnoreList() is called by 2 function(s): loadAndTransform, transformMiddleware.

Analyze Your Own Codebase

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

Try Supermodel Free