MCPcopy
hub / github.com/vitejs/vite / transform

Method transform

packages/vite/src/node/server/pluginContainer.ts:1294–1304  ·  view source on GitHub ↗
(
    code: string,
    id: string,
    options?: {
      ssr?: boolean
      environment?: Environment
      inMap?: SourceDescription['map']
    },
  )

Source from the content-addressed store, hash-verified

1292 }
1293
1294 async transform(
1295 code: string,
1296 id: string,
1297 options?: {
1298 ssr?: boolean
1299 environment?: Environment
1300 inMap?: SourceDescription['map']
1301 },
1302 ): Promise<{ code: string; map: SourceMap | { mappings: '' } | null }> {
1303 return this._getPluginContainer(options).transform(code, id, options)
1304 }
1305
1306 async close(): Promise<void> {
1307 // noop, close will be called for each environment

Callers 9

renderChunkFunction · 0.45
detectPolyfillsFunction · 0.45
loadMethod · 0.45
loadAndTransformFunction · 0.45
devHtmlHookFunction · 0.45
minifyCSSFunction · 0.45
index.spec.tsFile · 0.45

Calls 1

_getPluginContainerMethod · 0.95

Tested by

no test coverage detected