Home / Function/ findNeedTransformStyleAttribute() — vite Function Reference

findNeedTransformStyleAttribute() — vite Function Reference

Architecture documentation for the findNeedTransformStyleAttribute() function in html.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  650c28d7_c770_fab5_5304_b8acef13150f["findNeedTransformStyleAttribute()"]
  f8fe0737_718a_5509_b722_473f207d5906["html.ts"]
  650c28d7_c770_fab5_5304_b8acef13150f -->|defined in| f8fe0737_718a_5509_b722_473f207d5906
  39f26be8_b1d9_a756_3043_474687a6bbb7["buildHtmlPlugin()"]
  39f26be8_b1d9_a756_3043_474687a6bbb7 -->|calls| 650c28d7_c770_fab5_5304_b8acef13150f
  c7929a5b_9791_180a_9c0b_4f479fb4cf3f["devHtmlHook()"]
  c7929a5b_9791_180a_9c0b_4f479fb4cf3f -->|calls| 650c28d7_c770_fab5_5304_b8acef13150f
  f9a13b61_758d_6973_4d25_637ddaa2a22f["url()"]
  650c28d7_c770_fab5_5304_b8acef13150f -->|calls| f9a13b61_758d_6973_4d25_637ddaa2a22f
  5676d1b7_77c4_1ff6_740b_030441ebba61["file()"]
  650c28d7_c770_fab5_5304_b8acef13150f -->|calls| 5676d1b7_77c4_1ff6_740b_030441ebba61
  style 650c28d7_c770_fab5_5304_b8acef13150f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/plugins/html.ts lines 1053–1066

export function findNeedTransformStyleAttribute(
  node: DefaultTreeAdapterMap['element'],
): { attr: Token.Attribute; location?: Token.Location } | undefined {
  const attr = node.attrs.find(
    (prop) =>
      prop.prefix === undefined &&
      prop.name === 'style' &&
      // only url(...) or image-set(...) in css need to emit file
      (prop.value.includes('url(') || prop.value.includes('image-set(')),
  )
  if (!attr) return undefined
  const location = node.sourceCodeLocation?.attrs?.['style']
  return { attr, location }
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does findNeedTransformStyleAttribute() do?
findNeedTransformStyleAttribute() is a function in the vite codebase, defined in packages/vite/src/node/plugins/html.ts.
Where is findNeedTransformStyleAttribute() defined?
findNeedTransformStyleAttribute() is defined in packages/vite/src/node/plugins/html.ts at line 1053.
What does findNeedTransformStyleAttribute() call?
findNeedTransformStyleAttribute() calls 2 function(s): file, url.
What calls findNeedTransformStyleAttribute()?
findNeedTransformStyleAttribute() is called by 2 function(s): buildHtmlPlugin, devHtmlHook.

Analyze Your Own Codebase

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

Try Supermodel Free