Home / Function/ isImportUsed() — vue Function Reference

isImportUsed() — vue Function Reference

Architecture documentation for the isImportUsed() function in compileScript.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  4fe50d93_1397_443f_6dd0_df2c8c87a955["isImportUsed()"]
  c9346cac_54e3_f6ca_68a7_03c6e82c9609["compileScript.ts"]
  4fe50d93_1397_443f_6dd0_df2c8c87a955 -->|defined in| c9346cac_54e3_f6ca_68a7_03c6e82c9609
  4dff3da5_c3f4_4303_7989_1d16ed3f091d["compileScript()"]
  4dff3da5_c3f4_4303_7989_1d16ed3f091d -->|calls| 4fe50d93_1397_443f_6dd0_df2c8c87a955
  4963bb7f_aa8f_8391_a726_4dfb648391e3["hmrShouldReload()"]
  4963bb7f_aa8f_8391_a726_4dfb648391e3 -->|calls| 4fe50d93_1397_443f_6dd0_df2c8c87a955
  4bc89743_7d83_8a25_3b2c_4a23c4277478["resolveTemplateUsageCheckString()"]
  4fe50d93_1397_443f_6dd0_df2c8c87a955 -->|calls| 4bc89743_7d83_8a25_3b2c_4a23c4277478
  style 4fe50d93_1397_443f_6dd0_df2c8c87a955 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/compiler-sfc/src/compileScript.ts lines 1879–1889

function isImportUsed(
  local: string,
  sfc: SFCDescriptor,
  isTS: boolean
): boolean {
  return new RegExp(
    // #4274 escape $ since it's a special char in regex
    // (and is the only regex special char that is valid in identifiers)
    `[^\\w$_]${local.replace(/\$/g, '\\$')}[^\\w$_]`
  ).test(resolveTemplateUsageCheckString(sfc, isTS))
}

Domain

Subdomains

Frequently Asked Questions

What does isImportUsed() do?
isImportUsed() is a function in the vue codebase, defined in packages/compiler-sfc/src/compileScript.ts.
Where is isImportUsed() defined?
isImportUsed() is defined in packages/compiler-sfc/src/compileScript.ts at line 1879.
What does isImportUsed() call?
isImportUsed() calls 1 function(s): resolveTemplateUsageCheckString.
What calls isImportUsed()?
isImportUsed() is called by 2 function(s): compileScript, hmrShouldReload.

Analyze Your Own Codebase

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

Try Supermodel Free