Home / File/ indexHtml.ts — vite Source File

indexHtml.ts — vite Source File

Architecture documentation for indexHtml.ts, a typescript file in the vite codebase. 61 imports, 2 dependents.

File typescript ViteCore ConfigEngine 61 imports 2 dependents 9 functions

Entity Profile

Dependency Diagram

graph LR
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015["indexHtml.ts"]
  f8fe0737_718a_5509_b722_473f207d5906["html.ts"]
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015 --> f8fe0737_718a_5509_b722_473f207d5906
  d5d45990_f4f5_4756_d8ed_1b0506491a7f["IndexHtmlTransformHook"]
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015 --> d5d45990_f4f5_4756_d8ed_1b0506491a7f
  bf28c3ed_1de7_8026_dca5_48657723b46c["addToHTMLProxyCache"]
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015 --> bf28c3ed_1de7_8026_dca5_48657723b46c
  979ed295_1d80_37c1_156b_2bbf25fc21e4["applyHtmlTransforms"]
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015 --> 979ed295_1d80_37c1_156b_2bbf25fc21e4
  454378ea_32bf_8bfb_be5d_8095a717ea09["extractImportExpressionFromClassicScript"]
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015 --> 454378ea_32bf_8bfb_be5d_8095a717ea09
  650c28d7_c770_fab5_5304_b8acef13150f["findNeedTransformStyleAttribute"]
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015 --> 650c28d7_c770_fab5_5304_b8acef13150f
  a37f0802_91ab_f008_65a6_1e79c811c37f["getScriptInfo"]
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015 --> a37f0802_91ab_f008_65a6_1e79c811c37f
  74ff6a26_1c5b_a015_895e_a968330cb049["htmlEnvHook"]
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015 --> 74ff6a26_1c5b_a015_895e_a968330cb049
  0819abd4_be39_9b71_5bc7_55025fbeb47e["injectCspNonceMetaTagHook"]
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015 --> 0819abd4_be39_9b71_5bc7_55025fbeb47e
  7514180d_f3bd_4f07_5c4e_5911c2a70a4c["injectNonceAttributeTagHook"]
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015 --> 7514180d_f3bd_4f07_5c4e_5911c2a70a4c
  0a5ccc35_5940_e97a_b8cf_fa02cbb6f117["nodeIsElement"]
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015 --> 0a5ccc35_5940_e97a_b8cf_fa02cbb6f117
  370852c5_4762_1633_45af_f5ae49f7fc4e["overwriteAttrValue"]
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015 --> 370852c5_4762_1633_45af_f5ae49f7fc4e
  6c4a81f2_0b84_113e_b706_96c3d99e6151["postImportMapHook"]
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015 --> 6c4a81f2_0b84_113e_b706_96c3d99e6151
  f2e3401e_edbf_08a2_0460_cc85afbcd839["preImportMapHook"]
  3f56d5b2_9fca_532f_3bfc_6bfb2be77015 --> f2e3401e_edbf_08a2_0460_cc85afbcd839
  style 3f56d5b2_9fca_532f_3bfc_6bfb2be77015 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import fs from 'node:fs'
import fsp from 'node:fs/promises'
import path from 'node:path'
import MagicString from 'magic-string'
import type { SourceMapInput } from 'rolldown'
import type { DefaultTreeAdapterMap, Token } from 'parse5'
import type { Connect } from '#dep-types/connect'
import type { IndexHtmlTransformHook } from '../../plugins/html'
import {
  addToHTMLProxyCache,
  applyHtmlTransforms,
  extractImportExpressionFromClassicScript,
  findNeedTransformStyleAttribute,
  getScriptInfo,
  htmlEnvHook,
  htmlProxyResult,
  injectCspNonceMetaTagHook,
  injectNonceAttributeTagHook,
  nodeIsElement,
  overwriteAttrValue,
  postImportMapHook,
  preImportMapHook,
  removeViteIgnoreAttr,
  resolveHtmlTransforms,
  traverseHtml,
} from '../../plugins/html'
import type { PreviewServer, ResolvedConfig, ViteDevServer } from '../..'
import { send } from '../send'
import { CLIENT_PUBLIC_PATH, FS_PREFIX } from '../../constants'
import {
  ensureWatchedFile,
  fsPathFromId,
  getHash,
  injectQuery,
  isCSSRequest,
  isDevServer,
  isJSRequest,
  isParentDirectory,
  joinUrlSegments,
  normalizePath,
  processSrcSetSync,
  stripBase,
} from '../../utils'
import { checkPublicFile } from '../../publicDir'
import { getCodeWithSourcemap, injectSourcesContent } from '../sourcemap'
import { cleanUrl, unwrapId, wrapId } from '../../../shared/utils'
import { getNodeAssetAttributes } from '../../assetSource'
import {
  BasicMinimalPluginContext,
  basePluginContextMeta,
} from '../pluginContainer'
import { FullBundleDevEnvironment } from '../environments/fullBundleEnvironment'
import { getHmrImplementation } from '../../plugins/clientInjections'
import { checkLoadingAccess, respondWithAccessDenied } from './static'

interface AssetNode {
  start: number
  end: number
  code: string
}
// ... (560 more lines)

Domain

Subdomains

Frequently Asked Questions

What does indexHtml.ts do?
indexHtml.ts is a source file in the vite codebase, written in typescript. It belongs to the ViteCore domain, ConfigEngine subdomain.
What functions are defined in indexHtml.ts?
indexHtml.ts defines 9 function(s): createDevHtmlTransformFn, devHtmlHook, generateFallbackHtml, getHtmlFilename, indexHtmlMiddleware, isBareRelative, preTransformRequest, processNodeUrl, shouldPreTransform.
What does indexHtml.ts depend on?
indexHtml.ts imports 61 module(s): BasicMinimalPluginContext, FullBundleDevEnvironment, IndexHtmlTransformHook, addToHTMLProxyCache, applyHtmlTransforms, assetSource.ts, checkLoadingAccess, checkPublicFile, and 53 more.
What files import indexHtml.ts?
indexHtml.ts is imported by 2 file(s): index.ts, preview.ts.
Where is indexHtml.ts in the architecture?
indexHtml.ts is located at packages/vite/src/node/server/middlewares/indexHtml.ts (domain: ViteCore, subdomain: ConfigEngine, directory: packages/vite/src/node/server/middlewares).

Analyze Your Own Codebase

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

Try Supermodel Free