MCPcopy
hub / github.com/unplugin/unplugin-vue-components / stringifyComponentImport

Function stringifyComponentImport

src/core/utils.ts:103–114  ·  view source on GitHub ↗
({ as: name, from: path, name: importName, sideEffects }: ComponentInfo, ctx: Context)

Source from the content-addressed store, hash-verified

101}
102
103export function stringifyComponentImport({ as: name, from: path, name: importName, sideEffects }: ComponentInfo, ctx: Context) {
104 path = getTransformedPath(path, ctx.options.importPathTransform)
105
106 const imports = [
107 stringifyImport({ as: name, from: path, name: importName }),
108 ]
109
110 if (sideEffects)
111 toArray(sideEffects).forEach(i => imports.push(stringifyImport(i)))
112
113 return imports.join(';')
114}
115
116export function getNameFromFilePath(filePath: string, options: ResolvedOptions): string {
117 const { resolvedDirs, directoryAsNamespace, globalNamespaces, collapseSamePrefixes, root } = options

Callers 4

stringifyImportFunction · 0.90
transformComponentFunction · 0.90
transformDirectiveFunction · 0.90

Calls 2

getTransformedPathFunction · 0.85
stringifyImportFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…