vuetify-vite-plugin 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -180,13 +180,13 @@ function importPlugin(options) {
|
|
|
180
180
|
);
|
|
181
181
|
if (vueIdx === -1) {
|
|
182
182
|
config.logger.warn(
|
|
183
|
-
"[vite-plugin
|
|
183
|
+
"[vuetify-vite-plugin] No Vue plugin found \u2014 auto-import is a no-op. Add @vitejs/plugin-vue (Nuxt provides this automatically)."
|
|
184
184
|
);
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
187
|
if (selfIdx !== -1 && selfIdx < vueIdx) {
|
|
188
188
|
throw new Error(
|
|
189
|
-
"[vite-plugin
|
|
189
|
+
"[vuetify-vite-plugin] This plugin must be registered AFTER the Vue plugin. Move it below `vue()` in your plugins array."
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
192
|
const vuePlugin = config.plugins[vueIdx];
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/types.ts","../src/importPlugin.ts","../src/imports/parseTemplate.ts","../src/utils.ts","../src/imports/getImports.ts","../src/imports/generateImports.ts","../src/stylesPlugin.ts"],"sourcesContent":["import type { Plugin } from 'vite'\nimport { resolveOptions } from './types'\nimport { importPlugin } from './importPlugin'\nimport { stylesPlugin } from './stylesPlugin'\nimport type { Options } from './types'\n\n// ─── transformAssetUrls ───────────────────────────────────────────────────────\n// Tells @vitejs/plugin-vue which Vuetify component props carry asset URLs\n// (images, posters, etc.) so Vite can process them as static assets.\n// Mirrors the official plugin's export exactly.\n\nfunction toKebabCase (str = '') {\n return str\n .replace(/[^a-z]/gi, '-')\n .replace(/\\B([A-Z])/g, '-$1')\n .toLowerCase()\n}\n\nconst _transformAssetUrls: Record<string, string[]> = {\n VAppBar: ['image'],\n VAvatar: ['image'],\n VBanner: ['avatar'],\n VCard: ['image', 'prependAvatar', 'appendAvatar'],\n VCardItem: ['prependAvatar', 'appendAvatar'],\n VCarouselItem: ['src', 'lazySrc', 'srcset'],\n VChip: ['prependAvatar', 'appendAvatar'],\n VImg: ['src', 'lazySrc', 'srcset'],\n VListItem: ['prependAvatar', 'appendAvatar'],\n VNavigationDrawer:['image'],\n VParallax: ['src', 'lazySrc', 'srcset'],\n VToolbar: ['image'],\n}\n\n// Add kebab-case aliases and default HTML tag attrs\nfor (const [tag, attrs] of Object.entries(_transformAssetUrls)) {\n attrs.forEach(attr => {\n if (/[A-Z]/.test(attr)) attrs.push(toKebabCase(attr))\n })\n _transformAssetUrls[toKebabCase(tag)] = attrs\n}\nObject.assign(_transformAssetUrls, {\n video: ['src', 'poster'],\n source: ['src'],\n img: ['src'],\n image: ['xlink:href', 'href'],\n use: ['xlink:href', 'href'],\n})\n\nexport const transformAssetUrls = _transformAssetUrls\n\n// ─── Main plugin factory ──────────────────────────────────────────────────────\n\n/**\n * `vite-plugin-vuetify4`\n *\n * Drop-in Vite plugin for Vuetify 4 with:\n * - Tree-shaking auto-import (no `@vuetify/loader-shared` dependency)\n * - CSS / SASS / configFile style strategies\n * - Lab component support\n * - `transformAssetUrls` for @vitejs/plugin-vue\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { defineConfig } from 'vite'\n * import vue from '@vitejs/plugin-vue'\n * import vuetify from 'vite-plugin-vuetify4'\n *\n * export default defineConfig({\n * plugins: [\n * vue({ template: { transformAssetUrls: vuetify.transformAssetUrls } }),\n * vuetify({ styles: { configFile: 'src/styles/settings.scss' } }),\n * ],\n * })\n * ```\n */\nfunction vuetify (rawOptions: Options = {}): Plugin[] {\n const options = resolveOptions(rawOptions)\n const plugins: Plugin[] = []\n\n if (options.autoImport !== false) {\n plugins.push(importPlugin(options))\n }\n\n // Style plugin is only needed for non-default strategies\n if (\n options.styles === 'none' ||\n options.styles === 'sass' ||\n (typeof options.styles === 'object' && 'configFile' in options.styles)\n ) {\n plugins.push(stylesPlugin(options))\n }\n\n return plugins\n}\n\nvuetify.transformAssetUrls = transformAssetUrls\n\nexport default vuetify\n\n// Named exports for Nuxt module / programmatic usage\nexport type { Options, ImportPluginOptions, StylesOption, StylesConfigFile, ResolvedOptions } from './types'\nexport { importPlugin } from './importPlugin'\nexport { stylesPlugin } from './stylesPlugin'\nexport { generateImports } from './imports/generateImports'\nexport { parseTemplate } from './imports/parseTemplate'\n","import type * as Components from 'vuetify/components'\nimport type * as Directives from 'vuetify/directives'\n\n// ─── Auto-import options ──────────────────────────────────────────────────────\n\nexport interface ImportPluginOptions {\n /**\n * Include Vuetify Labs components (`vuetify/labs/*`).\n * @default false\n */\n labs?: boolean\n /**\n * Component or directive names to exclude from auto-import.\n * Useful when you want to manually register a component with a custom impl.\n */\n ignore?: (keyof typeof Components | keyof typeof Directives)[]\n}\n\n// ─── Styles options ───────────────────────────────────────────────────────────\n\nexport interface StylesConfigFile {\n /**\n * Path to a SASS/SCSS config file that is @use-d before every Vuetify\n * component stylesheet. Relative to `vite.config` root, or absolute.\n *\n * Example:\n * ```ts\n * styles: { configFile: 'src/styles/vuetify-settings.scss' }\n * ```\n */\n configFile: string\n}\n\n/**\n * How to handle Vuetify stylesheets:\n * - `true` — use the pre-compiled CSS (default, fastest)\n * - `'none'` — suppress all Vuetify CSS (you bring your own)\n * - `'sass'` — use the raw SASS/SCSS sources (requires sass)\n * - `{ configFile }` — use SASS sources prefixed with your settings file\n */\nexport type StylesOption = true | 'none' | 'sass' | StylesConfigFile\n\n// ─── Top-level options ────────────────────────────────────────────────────────\n\nexport interface Options {\n /**\n * Enable/configure component + directive auto-import with tree-shaking.\n * - `true` — auto-import everything (default)\n * - `false` — disable (you import manually or use a full bundle)\n * - `{ labs, ignore }` — fine-grained control\n */\n autoImport?: boolean | ImportPluginOptions\n\n /**\n * Stylesheet handling strategy.\n * @default true\n */\n styles?: StylesOption\n}\n\n// ─── Internal resolved types ──────────────────────────────────────────────────\n\nexport interface ResolvedOptions {\n autoImport: false | ImportPluginOptions\n styles: StylesOption\n}\n\nexport function resolveOptions (raw: Options): ResolvedOptions {\n const autoImport: ResolvedOptions['autoImport'] =\n raw.autoImport === false\n ? false\n : raw.autoImport === true || raw.autoImport == null\n ? {}\n : raw.autoImport\n\n return {\n autoImport,\n styles: raw.styles ?? true,\n }\n}\n","import { createFilter } from 'vite'\nimport type { Plugin, ResolvedConfig } from 'vite'\nimport { generateImports } from './imports/generateImports'\nimport type { ResolvedOptions } from './types'\n\nfunction parseId (id: string) {\n const [pathname, query] = id.split('?')\n return {\n path: pathname ?? id,\n query: query ? Object.fromEntries(new URLSearchParams(query)) : null,\n }\n}\n\n/**\n * `vuetify4:import`\n *\n * Intercepts every compiled Vue file / template chunk and replaces dynamic\n * `_resolveComponent(...)` calls with static tree-shakeable imports from the\n * Vuetify package.\n *\n * Must be placed AFTER the Vue plugin in the plugins array (enforced at\n * `configResolved` time).\n */\nexport function importPlugin (options: ResolvedOptions): Plugin {\n // Narrowed: if we reach here, autoImport is not false\n const importOptions = options.autoImport as Exclude<ResolvedOptions['autoImport'], false>\n let filter: (id: unknown) => boolean = () => true\n\n return {\n name: 'vuetify4:import',\n\n configResolved (config: ResolvedConfig) {\n const selfIdx = config.plugins.findIndex(p => p.name === 'vuetify4:import')\n const vueIdx = config.plugins.findIndex(p =>\n ['vite:vue', 'unplugin-vue'].includes(p.name)\n )\n\n if (vueIdx === -1) {\n config.logger.warn(\n '[vite-plugin-vuetify4] No Vue plugin found — ' +\n 'auto-import is a no-op. Add @vitejs/plugin-vue ' +\n '(Nuxt provides this automatically).'\n )\n return\n }\n\n if (selfIdx !== -1 && selfIdx < vueIdx) {\n throw new Error(\n '[vite-plugin-vuetify4] This plugin must be registered AFTER the Vue plugin. ' +\n 'Move it below `vue()` in your plugins array.'\n )\n }\n\n const vuePlugin = config.plugins[vueIdx] as any\n const vueOptions = vuePlugin?.api?.options ?? {}\n filter = createFilter(vueOptions.include, vueOptions.exclude)\n },\n\n transform (code, id) {\n const { path, query } = parseId(id)\n\n // A virtual sub-request appended by the Vue plugin (e.g. ?vue&type=template)\n const isVueVirtual = !!query && 'vue' in query\n const isVueFile =\n !isVueVirtual &&\n filter(path) &&\n // Skip render-only re-export stubs that the Vue plugin emits\n !/^import \\{ render as _sfc_render \\} from \".*\"$/m.test(code)\n const isVueTemplate =\n isVueVirtual &&\n (query!.type === 'template' ||\n (query!.type === 'script' && query!.setup === 'true'))\n\n if (isVueFile || isVueTemplate) {\n const { code: importCode, source } = generateImports(code, importOptions)\n return { code: source + importCode, map: null }\n }\n\n return null\n },\n }\n}\n","import { camelize, capitalize } from 'vue'\n\nexport interface TemplateMatch {\n /** The local JS symbol name, e.g. `_component_VBtn` */\n symbol: string\n /** PascalCase component/directive name, e.g. `VBtn` */\n name: string\n /** Byte offset of the match inside the source string */\n index: number\n /** Byte length of the matched substring */\n length: number\n}\n\n/**\n * Parse compiled Vue template code for `_resolveComponent(...)` and\n * `_resolveDirective(...)` calls and return typed match sets.\n *\n * The regex patterns mirror those in `@vuetify/loader-shared` exactly so\n * behaviour is identical.\n */\nexport function parseTemplate (source: string) {\n const components = collectMatches(\n source.matchAll(/(?:var|const) (\\w+) *?= *?_resolveComponent\\(\"([\\w-.]+)\"\\);?/gm)\n )\n const directives = collectMatches(\n source.matchAll(/(?:var|const) (\\w+) *?= *?_resolveDirective\\(\"([\\w-.]+)\"\\);?/gm)\n )\n return { components, directives }\n}\n\nfunction collectMatches (\n iter: IterableIterator<RegExpMatchArray>\n): Set<TemplateMatch> {\n return new Set(\n Array.from(iter, m => ({\n symbol: m[1],\n name: capitalize(camelize(m[2])),\n index: m.index!,\n length: m[0].length,\n }))\n )\n}\n","import { createRequire } from 'node:module'\nimport nodePath from 'node:path'\n\n// `__filename` is available in both output formats:\n// - CJS: provided natively by Node\n// - ESM: shimmed from `import.meta.url` via the tsup banner\nconst _require = createRequire(__filename)\n\n/**\n * Resolves the directory of the installed `vuetify` package.\n */\nexport function resolveVuetifyBase (): string {\n return nodePath.dirname(\n _require.resolve('vuetify/package.json', { paths: [process.cwd()] })\n )\n}\n\nexport function loadImportMap () {\n return _require('vuetify/dist/json/importMap.json') as ImportMap\n}\n\nexport function loadImportMapLabs () {\n return _require('vuetify/dist/json/importMap-labs.json') as ImportMap\n}\n\nexport interface ImportMap {\n components: Record<string, { from: string }>\n directives: string[]\n}\n\n/** Forward-slash paths on Windows for Vite/esbuild compatibility. */\nexport function normalizePath (p: string): string {\n p = nodePath.normalize(p).replace(/\\\\/g, '/')\n if (/^[a-z]:\\//i.test(p)) p = '/' + p\n return p\n}\n\nexport function isObject (value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object'\n}\n\nexport function isSubdir (root: string, test: string): boolean {\n const rel = nodePath.relative(root, test)\n return !!rel && !rel.startsWith('..') && !nodePath.isAbsolute(rel)\n}\n","import { parseTemplate } from './parseTemplate'\nimport { loadImportMap, loadImportMapLabs } from '../utils'\nimport type { TemplateMatch } from './parseTemplate'\nimport type { ImportPluginOptions } from '../types'\n\n/**\n * Given compiled Vue template source, returns:\n * - `imports` Map<from-specifier, [\"Name as _symbol\", ...]>\n * - `components` matched component descriptors (for source-rewriting)\n * - `directives` matched directive descriptors (for source-rewriting)\n */\nexport function getImports (source: string, options: ImportPluginOptions) {\n const importMap = loadImportMap()\n const importMapLabs = loadImportMapLabs()\n\n const { components, directives } = parseTemplate(source)\n const resolvedComponents: TemplateMatch[] = []\n const resolvedDirectives: TemplateMatch[] = []\n const imports = new Map<string, string[]>()\n\n const ignore = options.ignore ?? null\n const includeLabs = !!options.labs\n\n // Merge labs into the lookup when requested\n const componentMap: Record<string, { from: string }> = includeLabs\n ? { ...importMap.components, ...importMapLabs.components }\n : { ...importMap.components }\n\n components.forEach(c => {\n if (ignore?.includes(c.name as never)) return\n if (c.name in componentMap) resolvedComponents.push(c)\n })\n\n directives.forEach(d => {\n if (importMap.directives.includes(d.name) && !ignore?.includes(d.name as never)) {\n resolvedDirectives.push(d)\n }\n })\n\n resolvedComponents.forEach(c => {\n const { from } = componentMap[c.name]\n // Vuetify ≥3.7.11 / v4: `from` ends in `.mjs` and is a subpath export.\n // Older builds use a bare lib path.\n const specifier = from.endsWith('.mjs') ? `vuetify/lib/${from}` : `vuetify/${from}`\n addImport(imports, c.name, c.symbol, specifier)\n })\n\n resolvedDirectives.forEach(d => {\n addImport(imports, d.name, d.symbol, 'vuetify/directives')\n })\n\n return { imports, components: resolvedComponents, directives: resolvedDirectives }\n}\n\nfunction addImport (\n imports: Map<string, string[]>,\n name: string,\n as: string,\n from: string\n) {\n if (!imports.has(from)) imports.set(from, [])\n imports.get(from)!.push(`${name} as ${as}`)\n}\n","import { getImports } from './getImports'\nimport type { ImportPluginOptions } from '../types'\n\n/**\n * Core transform: given compiled Vue template `source`, generates static\n * Vuetify import statements and erases the `_resolveComponent(...)` /\n * `_resolveDirective(...)` declarations those imports replace.\n *\n * Returns `{ code, source }` where:\n * - `source` is the (possibly mutated) original code with dynamic-resolve\n * calls blanked out (spaces, preserving source-map columns).\n * - `code` is the new import block to prepend / append.\n */\nexport function generateImports (\n source: string,\n options: ImportPluginOptions\n): { code: string; source: string } {\n const { imports, components, directives } = getImports(source, options)\n\n let code = ''\n\n if (components.length || directives.length) {\n code += '\\n\\n/* Vuetify */\\n'\n\n // Sort import specifiers alphabetically for deterministic output\n Array.from(imports)\n .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))\n .forEach(([from, names]) => {\n code += `import { ${names.join(', ')} } from \"${from}\"\\n`\n })\n\n code += '\\n'\n\n // Replace matched substrings with spaces to preserve source-map columns\n source = [...components, ...directives].reduce((acc, v) => {\n return acc.slice(0, v.index) + ' '.repeat(v.length) + acc.slice(v.index + v.length)\n }, source)\n\n // If all resolveComponent / resolveDirective calls are gone, also strip\n // the named imports from the Vue runtime import at the top of the file.\n if (!source.includes('_resolveComponent(')) {\n source = source.replace('resolveComponent as _resolveComponent, ', '')\n }\n if (!source.includes('_resolveDirective(')) {\n source = source.replace('resolveDirective as _resolveDirective, ', '')\n }\n }\n\n return { code, source }\n}\n","import nodePath from 'node:path'\nimport fs from 'node:fs/promises'\nimport { resolveVuetifyBase, normalizePath, isObject, isSubdir } from './utils'\nimport type { Plugin, ResolvedConfig } from 'vite'\nimport type { ResolvedOptions, StylesConfigFile } from './types'\n\nconst VIRTUAL_PREFIX = 'virtual:'\nconst PLUGIN_VIRTUAL_NAME = 'plugin-vuetify4'\nconst VIRTUAL_MODULE_ID = `${VIRTUAL_PREFIX}${PLUGIN_VIRTUAL_NAME}`\n\n/**\n * `vuetify4:styles`\n *\n * Intercepts Vuetify's internal `.css` imports and redirects them according to\n * `options.styles`:\n *\n * - `'none'` → return empty module (suppress all Vuetify CSS)\n * - `'sass'` → resolve to the companion `.sass` / `.scss` source\n * - `{ configFile }` → prefix every component stylesheet with `@use configFile`\n *\n * When `styles: true` (default), this plugin is not added at all — Vite\n * handles the pre-compiled CSS normally.\n */\nexport function stylesPlugin (options: ResolvedOptions): Plugin {\n const vuetifyBase = resolveVuetifyBase()\n\n let configFile = ''\n // Virtual file contents keyed by relative path (configFile strategy)\n const tempFiles = new Map<string, string>()\n // Cache css → sass/scss path resolutions\n const cssToSass = new Map<string, string>()\n\n async function resolveSass (target: string): Promise<string> {\n let cached = cssToSass.get(target)\n if (!cached) {\n cached = target.replace(/\\.css$/, '.sass')\n try {\n await fs.access(cached, fs.constants.R_OK)\n } catch (err) {\n // Fallback to .scss\n if (err instanceof Error && 'code' in err && (err as NodeJS.ErrnoException).code === 'ENOENT') {\n cached = target.replace(/\\.css$/, '.scss')\n } else {\n throw err\n }\n }\n cssToSass.set(target, cached)\n }\n return cached\n }\n\n return {\n name: 'vuetify4:styles',\n enforce: 'pre', // Must run before Vite's default CSS resolution\n\n configResolved (config: ResolvedConfig) {\n if (isObject(options.styles) && 'configFile' in options.styles) {\n const cf = (options.styles as StylesConfigFile).configFile\n configFile = nodePath.isAbsolute(cf)\n ? cf\n : nodePath.join(config.root || process.cwd(), cf)\n }\n },\n\n async resolveId (source, importer, ctx) {\n const isVuetifyStyles =\n source === 'vuetify/styles' ||\n (\n importer &&\n source.endsWith('.css') &&\n isSubdir(\n vuetifyBase,\n nodePath.isAbsolute(source) ? source : importer\n )\n )\n\n if (isVuetifyStyles) {\n // ── Strategy: none ────────────────────────────────────────────────────\n if (options.styles === 'none') {\n return `${VIRTUAL_PREFIX}__void__`\n }\n\n // ── Strategy: sass ────────────────────────────────────────────────────\n if (options.styles === 'sass') {\n const resolution = await this.resolve(source, importer, {\n skipSelf: true,\n custom: ctx.custom,\n })\n if (!resolution) return null\n return resolveSass(resolution.id)\n }\n\n // ── Strategy: { configFile } ──────────────────────────────────────────\n if (isObject(options.styles) && 'configFile' in options.styles) {\n const resolution = await this.resolve(source, importer, {\n skipSelf: true,\n custom: ctx.custom,\n })\n if (!resolution) return null\n\n const sassFile = await resolveSass(resolution.id)\n const relFile = nodePath.relative(nodePath.join(vuetifyBase, 'lib'), sassFile)\n const suffix = sassFile.endsWith('.scss') ? ';\\n' : '\\n'\n const contents =\n `@use \"${normalizePath(configFile)}\"${suffix}` +\n `@use \"${normalizePath(sassFile)}\"${suffix}`\n\n tempFiles.set(relFile, contents)\n return `${VIRTUAL_MODULE_ID}:${relFile}`\n }\n }\n\n // ── Vite SSR virtual re-entry aliases ─────────────────────────────────\n if (source.startsWith(`/${PLUGIN_VIRTUAL_NAME}:`)) {\n return VIRTUAL_PREFIX + source.slice(1)\n }\n if (source.startsWith(`/@id/__x00__${PLUGIN_VIRTUAL_NAME}:`)) {\n return VIRTUAL_PREFIX + source.slice(12)\n }\n if (source.startsWith(`/${VIRTUAL_MODULE_ID}:`)) {\n return source.slice(1)\n }\n\n return null\n },\n\n load (id) {\n // __void__ — suppress CSS (styles: 'none')\n // Vite may append a version hash: `?v=abc123`\n if (new RegExp(`^${VIRTUAL_PREFIX}__void__(\\\\?.*)?$`).test(id)) {\n return ''\n }\n\n // Virtual config-prefixed sass files\n if (id.startsWith(VIRTUAL_MODULE_ID)) {\n const file = new RegExp(`^${VIRTUAL_MODULE_ID}:(.*?)(\\\\?.*)?$`).exec(id)?.[1]\n if (file) return tempFiles.get(file) ?? null\n }\n\n return null\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmEO,SAAS,eAAgB,KAA+B;AAC7D,QAAM,aACJ,IAAI,eAAe,QACf,QACA,IAAI,eAAe,QAAQ,IAAI,cAAc,OAC7C,CAAC,IACD,IAAI;AAEV,SAAO;AAAA,IACL;AAAA,IACA,QAAQ,IAAI,UAAU;AAAA,EACxB;AACF;;;AC/EA,kBAA6B;;;ACA7B,iBAAqC;AAoB9B,SAAS,cAAe,QAAgB;AAC7C,QAAM,aAAa;AAAA,IACjB,OAAO,SAAS,gEAAgE;AAAA,EAClF;AACA,QAAM,aAAa;AAAA,IACjB,OAAO,SAAS,gEAAgE;AAAA,EAClF;AACA,SAAO,EAAE,YAAY,WAAW;AAClC;AAEA,SAAS,eACP,MACoB;AACpB,SAAO,IAAI;AAAA,IACT,MAAM,KAAK,MAAM,QAAM;AAAA,MACrB,QAAQ,EAAE,CAAC;AAAA,MACX,UAAQ,2BAAW,qBAAS,EAAE,CAAC,CAAC,CAAC;AAAA,MACjC,OAAQ,EAAE;AAAA,MACV,QAAQ,EAAE,CAAC,EAAE;AAAA,IACf,EAAE;AAAA,EACJ;AACF;;;ACzCA,yBAA8B;AAC9B,uBAAqB;AAKrB,IAAM,eAAW,kCAAc,UAAU;AAKlC,SAAS,qBAA8B;AAC5C,SAAO,iBAAAA,QAAS;AAAA,IACd,SAAS,QAAQ,wBAAwB,EAAE,OAAO,CAAC,QAAQ,IAAI,CAAC,EAAE,CAAC;AAAA,EACrE;A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KAAK,IAAI,EAAG,OAAM,KAAK,YAAY,IAAI,CAAC;AAAA,EACtD,CAAC;AACD,sBAAoB,YAAY,GAAG,CAAC,IAAI;AAC1C;AACA,OAAO,OAAO,qBAAqB;AAAA,EACjC,OAAQ,CAAC,OAAO,QAAQ;AAAA,EACxB,QAAQ,CAAC,KAAK;AAAA,EACd,KAAQ,CAAC,KAAK;AAAA,EACd,OAAQ,CAAC,cAAc,MAAM;AAAA,EAC7B,KAAQ,CAAC,cAAc,MAAM;AAC/B,CAAC;AAEM,IAAM,qBAAqB;AA4BlC,SAAS,QAAS,aAAsB,CAAC,GAAa;AACpD,QAAM,UAAU,eAAe,UAAU;AACzC,QAAM,UAAoB,CAAC;AAE3B,MAAI,QAAQ,eAAe,OAAO;AAChC,YAAQ,KAAK,aAAa,OAAO,CAAC;AAAA,EACpC;AAGA,MACE,QAAQ,WAAW,UACnB,QAAQ,WAAW,UAClB,OAAO,QAAQ,WAAW,YAAY,gBAAgB,QAAQ,QAC/D;AACA,YAAQ,KAAK,aAAa,OAAO,CAAC;AAAA,EACpC;AAEA,SAAO;AACT;AAEA,QAAQ,qBAAqB;AAE7B,IAAO,gBAAQ;","names":["nodePath","import_node_path","fs","nodePath"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/types.ts","../src/importPlugin.ts","../src/imports/parseTemplate.ts","../src/utils.ts","../src/imports/getImports.ts","../src/imports/generateImports.ts","../src/stylesPlugin.ts"],"sourcesContent":["import type { Plugin } from 'vite'\nimport { resolveOptions } from './types'\nimport { importPlugin } from './importPlugin'\nimport { stylesPlugin } from './stylesPlugin'\nimport type { Options } from './types'\n\n// ─── transformAssetUrls ───────────────────────────────────────────────────────\n// Tells @vitejs/plugin-vue which Vuetify component props carry asset URLs\n// (images, posters, etc.) so Vite can process them as static assets.\n// Mirrors the official plugin's export exactly.\n\nfunction toKebabCase (str = '') {\n return str\n .replace(/[^a-z]/gi, '-')\n .replace(/\\B([A-Z])/g, '-$1')\n .toLowerCase()\n}\n\nconst _transformAssetUrls: Record<string, string[]> = {\n VAppBar: ['image'],\n VAvatar: ['image'],\n VBanner: ['avatar'],\n VCard: ['image', 'prependAvatar', 'appendAvatar'],\n VCardItem: ['prependAvatar', 'appendAvatar'],\n VCarouselItem: ['src', 'lazySrc', 'srcset'],\n VChip: ['prependAvatar', 'appendAvatar'],\n VImg: ['src', 'lazySrc', 'srcset'],\n VListItem: ['prependAvatar', 'appendAvatar'],\n VNavigationDrawer:['image'],\n VParallax: ['src', 'lazySrc', 'srcset'],\n VToolbar: ['image'],\n}\n\n// Add kebab-case aliases and default HTML tag attrs\nfor (const [tag, attrs] of Object.entries(_transformAssetUrls)) {\n attrs.forEach(attr => {\n if (/[A-Z]/.test(attr)) attrs.push(toKebabCase(attr))\n })\n _transformAssetUrls[toKebabCase(tag)] = attrs\n}\nObject.assign(_transformAssetUrls, {\n video: ['src', 'poster'],\n source: ['src'],\n img: ['src'],\n image: ['xlink:href', 'href'],\n use: ['xlink:href', 'href'],\n})\n\nexport const transformAssetUrls = _transformAssetUrls\n\n// ─── Main plugin factory ──────────────────────────────────────────────────────\n\n/**\n * `vuetify-vite-plugin`\n *\n * Drop-in Vite plugin for Vuetify 4 with:\n * - Tree-shaking auto-import (no `@vuetify/loader-shared` dependency)\n * - CSS / SASS / configFile style strategies\n * - Lab component support\n * - `transformAssetUrls` for @vitejs/plugin-vue\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { defineConfig } from 'vite'\n * import vue from '@vitejs/plugin-vue'\n * import vuetify from 'vuetify-vite-plugin'\n *\n * export default defineConfig({\n * plugins: [\n * vue({ template: { transformAssetUrls: vuetify.transformAssetUrls } }),\n * vuetify({ styles: { configFile: 'src/styles/settings.scss' } }),\n * ],\n * })\n * ```\n */\nfunction vuetify (rawOptions: Options = {}): Plugin[] {\n const options = resolveOptions(rawOptions)\n const plugins: Plugin[] = []\n\n if (options.autoImport !== false) {\n plugins.push(importPlugin(options))\n }\n\n // Style plugin is only needed for non-default strategies\n if (\n options.styles === 'none' ||\n options.styles === 'sass' ||\n (typeof options.styles === 'object' && 'configFile' in options.styles)\n ) {\n plugins.push(stylesPlugin(options))\n }\n\n return plugins\n}\n\nvuetify.transformAssetUrls = transformAssetUrls\n\nexport default vuetify\n\n// Named exports for Nuxt module / programmatic usage\nexport type { Options, ImportPluginOptions, StylesOption, StylesConfigFile, ResolvedOptions } from './types'\nexport { importPlugin } from './importPlugin'\nexport { stylesPlugin } from './stylesPlugin'\nexport { generateImports } from './imports/generateImports'\nexport { parseTemplate } from './imports/parseTemplate'\n","import type * as Components from 'vuetify/components'\nimport type * as Directives from 'vuetify/directives'\n\n// ─── Auto-import options ──────────────────────────────────────────────────────\n\nexport interface ImportPluginOptions {\n /**\n * Include Vuetify Labs components (`vuetify/labs/*`).\n * @default false\n */\n labs?: boolean\n /**\n * Component or directive names to exclude from auto-import.\n * Useful when you want to manually register a component with a custom impl.\n */\n ignore?: (keyof typeof Components | keyof typeof Directives)[]\n}\n\n// ─── Styles options ───────────────────────────────────────────────────────────\n\nexport interface StylesConfigFile {\n /**\n * Path to a SASS/SCSS config file that is @use-d before every Vuetify\n * component stylesheet. Relative to `vite.config` root, or absolute.\n *\n * Example:\n * ```ts\n * styles: { configFile: 'src/styles/vuetify-settings.scss' }\n * ```\n */\n configFile: string\n}\n\n/**\n * How to handle Vuetify stylesheets:\n * - `true` — use the pre-compiled CSS (default, fastest)\n * - `'none'` — suppress all Vuetify CSS (you bring your own)\n * - `'sass'` — use the raw SASS/SCSS sources (requires sass)\n * - `{ configFile }` — use SASS sources prefixed with your settings file\n */\nexport type StylesOption = true | 'none' | 'sass' | StylesConfigFile\n\n// ─── Top-level options ────────────────────────────────────────────────────────\n\nexport interface Options {\n /**\n * Enable/configure component + directive auto-import with tree-shaking.\n * - `true` — auto-import everything (default)\n * - `false` — disable (you import manually or use a full bundle)\n * - `{ labs, ignore }` — fine-grained control\n */\n autoImport?: boolean | ImportPluginOptions\n\n /**\n * Stylesheet handling strategy.\n * @default true\n */\n styles?: StylesOption\n}\n\n// ─── Internal resolved types ──────────────────────────────────────────────────\n\nexport interface ResolvedOptions {\n autoImport: false | ImportPluginOptions\n styles: StylesOption\n}\n\nexport function resolveOptions (raw: Options): ResolvedOptions {\n const autoImport: ResolvedOptions['autoImport'] =\n raw.autoImport === false\n ? false\n : raw.autoImport === true || raw.autoImport == null\n ? {}\n : raw.autoImport\n\n return {\n autoImport,\n styles: raw.styles ?? true,\n }\n}\n","import { createFilter } from 'vite'\nimport type { Plugin, ResolvedConfig } from 'vite'\nimport { generateImports } from './imports/generateImports'\nimport type { ResolvedOptions } from './types'\n\nfunction parseId (id: string) {\n const [pathname, query] = id.split('?')\n return {\n path: pathname ?? id,\n query: query ? Object.fromEntries(new URLSearchParams(query)) : null,\n }\n}\n\n/**\n * `vuetify4:import`\n *\n * Intercepts every compiled Vue file / template chunk and replaces dynamic\n * `_resolveComponent(...)` calls with static tree-shakeable imports from the\n * Vuetify package.\n *\n * Must be placed AFTER the Vue plugin in the plugins array (enforced at\n * `configResolved` time).\n */\nexport function importPlugin (options: ResolvedOptions): Plugin {\n // Narrowed: if we reach here, autoImport is not false\n const importOptions = options.autoImport as Exclude<ResolvedOptions['autoImport'], false>\n let filter: (id: unknown) => boolean = () => true\n\n return {\n name: 'vuetify4:import',\n\n configResolved (config: ResolvedConfig) {\n const selfIdx = config.plugins.findIndex(p => p.name === 'vuetify4:import')\n const vueIdx = config.plugins.findIndex(p =>\n ['vite:vue', 'unplugin-vue'].includes(p.name)\n )\n\n if (vueIdx === -1) {\n config.logger.warn(\n '[vuetify-vite-plugin] No Vue plugin found — ' +\n 'auto-import is a no-op. Add @vitejs/plugin-vue ' +\n '(Nuxt provides this automatically).'\n )\n return\n }\n\n if (selfIdx !== -1 && selfIdx < vueIdx) {\n throw new Error(\n '[vuetify-vite-plugin] This plugin must be registered AFTER the Vue plugin. ' +\n 'Move it below `vue()` in your plugins array.'\n )\n }\n\n const vuePlugin = config.plugins[vueIdx] as any\n const vueOptions = vuePlugin?.api?.options ?? {}\n filter = createFilter(vueOptions.include, vueOptions.exclude)\n },\n\n transform (code, id) {\n const { path, query } = parseId(id)\n\n // A virtual sub-request appended by the Vue plugin (e.g. ?vue&type=template)\n const isVueVirtual = !!query && 'vue' in query\n const isVueFile =\n !isVueVirtual &&\n filter(path) &&\n // Skip render-only re-export stubs that the Vue plugin emits\n !/^import \\{ render as _sfc_render \\} from \".*\"$/m.test(code)\n const isVueTemplate =\n isVueVirtual &&\n (query!.type === 'template' ||\n (query!.type === 'script' && query!.setup === 'true'))\n\n if (isVueFile || isVueTemplate) {\n const { code: importCode, source } = generateImports(code, importOptions)\n return { code: source + importCode, map: null }\n }\n\n return null\n },\n }\n}\n","import { camelize, capitalize } from 'vue'\n\nexport interface TemplateMatch {\n /** The local JS symbol name, e.g. `_component_VBtn` */\n symbol: string\n /** PascalCase component/directive name, e.g. `VBtn` */\n name: string\n /** Byte offset of the match inside the source string */\n index: number\n /** Byte length of the matched substring */\n length: number\n}\n\n/**\n * Parse compiled Vue template code for `_resolveComponent(...)` and\n * `_resolveDirective(...)` calls and return typed match sets.\n *\n * The regex patterns mirror those in `@vuetify/loader-shared` exactly so\n * behaviour is identical.\n */\nexport function parseTemplate (source: string) {\n const components = collectMatches(\n source.matchAll(/(?:var|const) (\\w+) *?= *?_resolveComponent\\(\"([\\w-.]+)\"\\);?/gm)\n )\n const directives = collectMatches(\n source.matchAll(/(?:var|const) (\\w+) *?= *?_resolveDirective\\(\"([\\w-.]+)\"\\);?/gm)\n )\n return { components, directives }\n}\n\nfunction collectMatches (\n iter: IterableIterator<RegExpMatchArray>\n): Set<TemplateMatch> {\n return new Set(\n Array.from(iter, m => ({\n symbol: m[1],\n name: capitalize(camelize(m[2])),\n index: m.index!,\n length: m[0].length,\n }))\n )\n}\n","import { createRequire } from 'node:module'\nimport nodePath from 'node:path'\n\n// `__filename` is available in both output formats:\n// - CJS: provided natively by Node\n// - ESM: shimmed from `import.meta.url` via the tsup banner\nconst _require = createRequire(__filename)\n\n/**\n * Resolves the directory of the installed `vuetify` package.\n */\nexport function resolveVuetifyBase (): string {\n return nodePath.dirname(\n _require.resolve('vuetify/package.json', { paths: [process.cwd()] })\n )\n}\n\nexport function loadImportMap () {\n return _require('vuetify/dist/json/importMap.json') as ImportMap\n}\n\nexport function loadImportMapLabs () {\n return _require('vuetify/dist/json/importMap-labs.json') as ImportMap\n}\n\nexport interface ImportMap {\n components: Record<string, { from: string }>\n directives: string[]\n}\n\n/** Forward-slash paths on Windows for Vite/esbuild compatibility. */\nexport function normalizePath (p: string): string {\n p = nodePath.normalize(p).replace(/\\\\/g, '/')\n if (/^[a-z]:\\//i.test(p)) p = '/' + p\n return p\n}\n\nexport function isObject (value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object'\n}\n\nexport function isSubdir (root: string, test: string): boolean {\n const rel = nodePath.relative(root, test)\n return !!rel && !rel.startsWith('..') && !nodePath.isAbsolute(rel)\n}\n","import { parseTemplate } from './parseTemplate'\nimport { loadImportMap, loadImportMapLabs } from '../utils'\nimport type { TemplateMatch } from './parseTemplate'\nimport type { ImportPluginOptions } from '../types'\n\n/**\n * Given compiled Vue template source, returns:\n * - `imports` Map<from-specifier, [\"Name as _symbol\", ...]>\n * - `components` matched component descriptors (for source-rewriting)\n * - `directives` matched directive descriptors (for source-rewriting)\n */\nexport function getImports (source: string, options: ImportPluginOptions) {\n const importMap = loadImportMap()\n const importMapLabs = loadImportMapLabs()\n\n const { components, directives } = parseTemplate(source)\n const resolvedComponents: TemplateMatch[] = []\n const resolvedDirectives: TemplateMatch[] = []\n const imports = new Map<string, string[]>()\n\n const ignore = options.ignore ?? null\n const includeLabs = !!options.labs\n\n // Merge labs into the lookup when requested\n const componentMap: Record<string, { from: string }> = includeLabs\n ? { ...importMap.components, ...importMapLabs.components }\n : { ...importMap.components }\n\n components.forEach(c => {\n if (ignore?.includes(c.name as never)) return\n if (c.name in componentMap) resolvedComponents.push(c)\n })\n\n directives.forEach(d => {\n if (importMap.directives.includes(d.name) && !ignore?.includes(d.name as never)) {\n resolvedDirectives.push(d)\n }\n })\n\n resolvedComponents.forEach(c => {\n const { from } = componentMap[c.name]\n // Vuetify ≥3.7.11 / v4: `from` ends in `.mjs` and is a subpath export.\n // Older builds use a bare lib path.\n const specifier = from.endsWith('.mjs') ? `vuetify/lib/${from}` : `vuetify/${from}`\n addImport(imports, c.name, c.symbol, specifier)\n })\n\n resolvedDirectives.forEach(d => {\n addImport(imports, d.name, d.symbol, 'vuetify/directives')\n })\n\n return { imports, components: resolvedComponents, directives: resolvedDirectives }\n}\n\nfunction addImport (\n imports: Map<string, string[]>,\n name: string,\n as: string,\n from: string\n) {\n if (!imports.has(from)) imports.set(from, [])\n imports.get(from)!.push(`${name} as ${as}`)\n}\n","import { getImports } from './getImports'\nimport type { ImportPluginOptions } from '../types'\n\n/**\n * Core transform: given compiled Vue template `source`, generates static\n * Vuetify import statements and erases the `_resolveComponent(...)` /\n * `_resolveDirective(...)` declarations those imports replace.\n *\n * Returns `{ code, source }` where:\n * - `source` is the (possibly mutated) original code with dynamic-resolve\n * calls blanked out (spaces, preserving source-map columns).\n * - `code` is the new import block to prepend / append.\n */\nexport function generateImports (\n source: string,\n options: ImportPluginOptions\n): { code: string; source: string } {\n const { imports, components, directives } = getImports(source, options)\n\n let code = ''\n\n if (components.length || directives.length) {\n code += '\\n\\n/* Vuetify */\\n'\n\n // Sort import specifiers alphabetically for deterministic output\n Array.from(imports)\n .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))\n .forEach(([from, names]) => {\n code += `import { ${names.join(', ')} } from \"${from}\"\\n`\n })\n\n code += '\\n'\n\n // Replace matched substrings with spaces to preserve source-map columns\n source = [...components, ...directives].reduce((acc, v) => {\n return acc.slice(0, v.index) + ' '.repeat(v.length) + acc.slice(v.index + v.length)\n }, source)\n\n // If all resolveComponent / resolveDirective calls are gone, also strip\n // the named imports from the Vue runtime import at the top of the file.\n if (!source.includes('_resolveComponent(')) {\n source = source.replace('resolveComponent as _resolveComponent, ', '')\n }\n if (!source.includes('_resolveDirective(')) {\n source = source.replace('resolveDirective as _resolveDirective, ', '')\n }\n }\n\n return { code, source }\n}\n","import nodePath from 'node:path'\nimport fs from 'node:fs/promises'\nimport { resolveVuetifyBase, normalizePath, isObject, isSubdir } from './utils'\nimport type { Plugin, ResolvedConfig } from 'vite'\nimport type { ResolvedOptions, StylesConfigFile } from './types'\n\nconst VIRTUAL_PREFIX = 'virtual:'\nconst PLUGIN_VIRTUAL_NAME = 'plugin-vuetify4'\nconst VIRTUAL_MODULE_ID = `${VIRTUAL_PREFIX}${PLUGIN_VIRTUAL_NAME}`\n\n/**\n * `vuetify4:styles`\n *\n * Intercepts Vuetify's internal `.css` imports and redirects them according to\n * `options.styles`:\n *\n * - `'none'` → return empty module (suppress all Vuetify CSS)\n * - `'sass'` → resolve to the companion `.sass` / `.scss` source\n * - `{ configFile }` → prefix every component stylesheet with `@use configFile`\n *\n * When `styles: true` (default), this plugin is not added at all — Vite\n * handles the pre-compiled CSS normally.\n */\nexport function stylesPlugin (options: ResolvedOptions): Plugin {\n const vuetifyBase = resolveVuetifyBase()\n\n let configFile = ''\n // Virtual file contents keyed by relative path (configFile strategy)\n const tempFiles = new Map<string, string>()\n // Cache css → sass/scss path resolutions\n const cssToSass = new Map<string, string>()\n\n async function resolveSass (target: string): Promise<string> {\n let cached = cssToSass.get(target)\n if (!cached) {\n cached = target.replace(/\\.css$/, '.sass')\n try {\n await fs.access(cached, fs.constants.R_OK)\n } catch (err) {\n // Fallback to .scss\n if (err instanceof Error && 'code' in err && (err as NodeJS.ErrnoException).code === 'ENOENT') {\n cached = target.replace(/\\.css$/, '.scss')\n } else {\n throw err\n }\n }\n cssToSass.set(target, cached)\n }\n return cached\n }\n\n return {\n name: 'vuetify4:styles',\n enforce: 'pre', // Must run before Vite's default CSS resolution\n\n configResolved (config: ResolvedConfig) {\n if (isObject(options.styles) && 'configFile' in options.styles) {\n const cf = (options.styles as StylesConfigFile).configFile\n configFile = nodePath.isAbsolute(cf)\n ? cf\n : nodePath.join(config.root || process.cwd(), cf)\n }\n },\n\n async resolveId (source, importer, ctx) {\n const isVuetifyStyles =\n source === 'vuetify/styles' ||\n (\n importer &&\n source.endsWith('.css') &&\n isSubdir(\n vuetifyBase,\n nodePath.isAbsolute(source) ? source : importer\n )\n )\n\n if (isVuetifyStyles) {\n // ── Strategy: none ────────────────────────────────────────────────────\n if (options.styles === 'none') {\n return `${VIRTUAL_PREFIX}__void__`\n }\n\n // ── Strategy: sass ────────────────────────────────────────────────────\n if (options.styles === 'sass') {\n const resolution = await this.resolve(source, importer, {\n skipSelf: true,\n custom: ctx.custom,\n })\n if (!resolution) return null\n return resolveSass(resolution.id)\n }\n\n // ── Strategy: { configFile } ──────────────────────────────────────────\n if (isObject(options.styles) && 'configFile' in options.styles) {\n const resolution = await this.resolve(source, importer, {\n skipSelf: true,\n custom: ctx.custom,\n })\n if (!resolution) return null\n\n const sassFile = await resolveSass(resolution.id)\n const relFile = nodePath.relative(nodePath.join(vuetifyBase, 'lib'), sassFile)\n const suffix = sassFile.endsWith('.scss') ? ';\\n' : '\\n'\n const contents =\n `@use \"${normalizePath(configFile)}\"${suffix}` +\n `@use \"${normalizePath(sassFile)}\"${suffix}`\n\n tempFiles.set(relFile, contents)\n return `${VIRTUAL_MODULE_ID}:${relFile}`\n }\n }\n\n // ── Vite SSR virtual re-entry aliases ─────────────────────────────────\n if (source.startsWith(`/${PLUGIN_VIRTUAL_NAME}:`)) {\n return VIRTUAL_PREFIX + source.slice(1)\n }\n if (source.startsWith(`/@id/__x00__${PLUGIN_VIRTUAL_NAME}:`)) {\n return VIRTUAL_PREFIX + source.slice(12)\n }\n if (source.startsWith(`/${VIRTUAL_MODULE_ID}:`)) {\n return source.slice(1)\n }\n\n return null\n },\n\n load (id) {\n // __void__ — suppress CSS (styles: 'none')\n // Vite may append a version hash: `?v=abc123`\n if (new RegExp(`^${VIRTUAL_PREFIX}__void__(\\\\?.*)?$`).test(id)) {\n return ''\n }\n\n // Virtual config-prefixed sass files\n if (id.startsWith(VIRTUAL_MODULE_ID)) {\n const file = new RegExp(`^${VIRTUAL_MODULE_ID}:(.*?)(\\\\?.*)?$`).exec(id)?.[1]\n if (file) return tempFiles.get(file) ?? null\n }\n\n return null\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmEO,SAAS,eAAgB,KAA+B;AAC7D,QAAM,aACJ,IAAI,eAAe,QACf,QACA,IAAI,eAAe,QAAQ,IAAI,cAAc,OAC7C,CAAC,IACD,IAAI;AAEV,SAAO;AAAA,IACL;AAAA,IACA,QAAQ,IAAI,UAAU;AAAA,EACxB;AACF;;;AC/EA,kBAA6B;;;ACA7B,iBAAqC;AAoB9B,SAAS,cAAe,QAAgB;AAC7C,QAAM,aAAa;AAAA,IACjB,OAAO,SAAS,gEAAgE;AAAA,EAClF;AACA,QAAM,aAAa;AAAA,IACjB,OAAO,SAAS,gEAAgE;AAAA,EAClF;AACA,SAAO,EAAE,YAAY,WAAW;AAClC;AAEA,SAAS,eACP,MACoB;AACpB,SAAO,IAAI;AAAA,IACT,MAAM,KAAK,MAAM,QAAM;AAAA,MACrB,QAAQ,EAAE,CAAC;AAAA,MACX,UAAQ,2BAAW,qBAAS,EAAE,CAAC,CAAC,CAAC;AAAA,MACjC,OAAQ,EAAE;AAAA,MACV,QAAQ,EAAE,CAAC,EAAE;AAAA,IACf,EAAE;AAAA,EACJ;AACF;;;ACzCA,yBAA8B;AAC9B,uBAAqB;AAKrB,IAAM,eAAW,kCAAc,UAAU;AAKlC,SAAS,qBAA8B;AAC5C,SAAO,iBAAAA,QAAS;AAAA,IACd,SAAS,QAAQ,wBAAwB,EAAE,OAAO,CAAC,QAAQ,IAAI,CAAC,EAAE,CAAC;AAAA,EACrE;AACF;AAEO,SAAS,gBAAiB;AAC/B,S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AY,IAAI,CAAC;AAAA,EACtD,CAAC;AACD,sBAAoB,YAAY,GAAG,CAAC,IAAI;AAC1C;AACA,OAAO,OAAO,qBAAqB;AAAA,EACjC,OAAQ,CAAC,OAAO,QAAQ;AAAA,EACxB,QAAQ,CAAC,KAAK;AAAA,EACd,KAAQ,CAAC,KAAK;AAAA,EACd,OAAQ,CAAC,cAAc,MAAM;AAAA,EAC7B,KAAQ,CAAC,cAAc,MAAM;AAC/B,CAAC;AAEM,IAAM,qBAAqB;AA4BlC,SAAS,QAAS,aAAsB,CAAC,GAAa;AACpD,QAAM,UAAU,eAAe,UAAU;AACzC,QAAM,UAAoB,CAAC;AAE3B,MAAI,QAAQ,eAAe,OAAO;AAChC,YAAQ,KAAK,aAAa,OAAO,CAAC;AAAA,EACpC;AAGA,MACE,QAAQ,WAAW,UACnB,QAAQ,WAAW,UAClB,OAAO,QAAQ,WAAW,YAAY,gBAAgB,QAAQ,QAC/D;AACA,YAAQ,KAAK,aAAa,OAAO,CAAC;AAAA,EACpC;AAEA,SAAO;AACT;AAEA,QAAQ,qBAAqB;AAE7B,IAAO,gBAAQ;","names":["nodePath","import_node_path","fs","nodePath"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -119,7 +119,7 @@ declare function parseTemplate(source: string): {
|
|
|
119
119
|
|
|
120
120
|
declare const transformAssetUrls: Record<string, string[]>;
|
|
121
121
|
/**
|
|
122
|
-
* `vite-plugin
|
|
122
|
+
* `vuetify-vite-plugin`
|
|
123
123
|
*
|
|
124
124
|
* Drop-in Vite plugin for Vuetify 4 with:
|
|
125
125
|
* - Tree-shaking auto-import (no `@vuetify/loader-shared` dependency)
|
|
@@ -132,7 +132,7 @@ declare const transformAssetUrls: Record<string, string[]>;
|
|
|
132
132
|
* // vite.config.ts
|
|
133
133
|
* import { defineConfig } from 'vite'
|
|
134
134
|
* import vue from '@vitejs/plugin-vue'
|
|
135
|
-
* import vuetify from 'vite-plugin
|
|
135
|
+
* import vuetify from 'vuetify-vite-plugin'
|
|
136
136
|
*
|
|
137
137
|
* export default defineConfig({
|
|
138
138
|
* plugins: [
|
package/dist/index.js
CHANGED
|
@@ -142,13 +142,13 @@ function importPlugin(options) {
|
|
|
142
142
|
);
|
|
143
143
|
if (vueIdx === -1) {
|
|
144
144
|
config.logger.warn(
|
|
145
|
-
"[vite-plugin
|
|
145
|
+
"[vuetify-vite-plugin] No Vue plugin found \u2014 auto-import is a no-op. Add @vitejs/plugin-vue (Nuxt provides this automatically)."
|
|
146
146
|
);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
if (selfIdx !== -1 && selfIdx < vueIdx) {
|
|
150
150
|
throw new Error(
|
|
151
|
-
"[vite-plugin
|
|
151
|
+
"[vuetify-vite-plugin] This plugin must be registered AFTER the Vue plugin. Move it below `vue()` in your plugins array."
|
|
152
152
|
);
|
|
153
153
|
}
|
|
154
154
|
const vuePlugin = config.plugins[vueIdx];
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts","../src/importPlugin.ts","../src/imports/parseTemplate.ts","../src/utils.ts","../src/imports/getImports.ts","../src/imports/generateImports.ts","../src/stylesPlugin.ts","../src/index.ts"],"sourcesContent":["import type * as Components from 'vuetify/components'\nimport type * as Directives from 'vuetify/directives'\n\n// ─── Auto-import options ──────────────────────────────────────────────────────\n\nexport interface ImportPluginOptions {\n /**\n * Include Vuetify Labs components (`vuetify/labs/*`).\n * @default false\n */\n labs?: boolean\n /**\n * Component or directive names to exclude from auto-import.\n * Useful when you want to manually register a component with a custom impl.\n */\n ignore?: (keyof typeof Components | keyof typeof Directives)[]\n}\n\n// ─── Styles options ───────────────────────────────────────────────────────────\n\nexport interface StylesConfigFile {\n /**\n * Path to a SASS/SCSS config file that is @use-d before every Vuetify\n * component stylesheet. Relative to `vite.config` root, or absolute.\n *\n * Example:\n * ```ts\n * styles: { configFile: 'src/styles/vuetify-settings.scss' }\n * ```\n */\n configFile: string\n}\n\n/**\n * How to handle Vuetify stylesheets:\n * - `true` — use the pre-compiled CSS (default, fastest)\n * - `'none'` — suppress all Vuetify CSS (you bring your own)\n * - `'sass'` — use the raw SASS/SCSS sources (requires sass)\n * - `{ configFile }` — use SASS sources prefixed with your settings file\n */\nexport type StylesOption = true | 'none' | 'sass' | StylesConfigFile\n\n// ─── Top-level options ────────────────────────────────────────────────────────\n\nexport interface Options {\n /**\n * Enable/configure component + directive auto-import with tree-shaking.\n * - `true` — auto-import everything (default)\n * - `false` — disable (you import manually or use a full bundle)\n * - `{ labs, ignore }` — fine-grained control\n */\n autoImport?: boolean | ImportPluginOptions\n\n /**\n * Stylesheet handling strategy.\n * @default true\n */\n styles?: StylesOption\n}\n\n// ─── Internal resolved types ──────────────────────────────────────────────────\n\nexport interface ResolvedOptions {\n autoImport: false | ImportPluginOptions\n styles: StylesOption\n}\n\nexport function resolveOptions (raw: Options): ResolvedOptions {\n const autoImport: ResolvedOptions['autoImport'] =\n raw.autoImport === false\n ? false\n : raw.autoImport === true || raw.autoImport == null\n ? {}\n : raw.autoImport\n\n return {\n autoImport,\n styles: raw.styles ?? true,\n }\n}\n","import { createFilter } from 'vite'\nimport type { Plugin, ResolvedConfig } from 'vite'\nimport { generateImports } from './imports/generateImports'\nimport type { ResolvedOptions } from './types'\n\nfunction parseId (id: string) {\n const [pathname, query] = id.split('?')\n return {\n path: pathname ?? id,\n query: query ? Object.fromEntries(new URLSearchParams(query)) : null,\n }\n}\n\n/**\n * `vuetify4:import`\n *\n * Intercepts every compiled Vue file / template chunk and replaces dynamic\n * `_resolveComponent(...)` calls with static tree-shakeable imports from the\n * Vuetify package.\n *\n * Must be placed AFTER the Vue plugin in the plugins array (enforced at\n * `configResolved` time).\n */\nexport function importPlugin (options: ResolvedOptions): Plugin {\n // Narrowed: if we reach here, autoImport is not false\n const importOptions = options.autoImport as Exclude<ResolvedOptions['autoImport'], false>\n let filter: (id: unknown) => boolean = () => true\n\n return {\n name: 'vuetify4:import',\n\n configResolved (config: ResolvedConfig) {\n const selfIdx = config.plugins.findIndex(p => p.name === 'vuetify4:import')\n const vueIdx = config.plugins.findIndex(p =>\n ['vite:vue', 'unplugin-vue'].includes(p.name)\n )\n\n if (vueIdx === -1) {\n config.logger.warn(\n '[vite-plugin-vuetify4] No Vue plugin found — ' +\n 'auto-import is a no-op. Add @vitejs/plugin-vue ' +\n '(Nuxt provides this automatically).'\n )\n return\n }\n\n if (selfIdx !== -1 && selfIdx < vueIdx) {\n throw new Error(\n '[vite-plugin-vuetify4] This plugin must be registered AFTER the Vue plugin. ' +\n 'Move it below `vue()` in your plugins array.'\n )\n }\n\n const vuePlugin = config.plugins[vueIdx] as any\n const vueOptions = vuePlugin?.api?.options ?? {}\n filter = createFilter(vueOptions.include, vueOptions.exclude)\n },\n\n transform (code, id) {\n const { path, query } = parseId(id)\n\n // A virtual sub-request appended by the Vue plugin (e.g. ?vue&type=template)\n const isVueVirtual = !!query && 'vue' in query\n const isVueFile =\n !isVueVirtual &&\n filter(path) &&\n // Skip render-only re-export stubs that the Vue plugin emits\n !/^import \\{ render as _sfc_render \\} from \".*\"$/m.test(code)\n const isVueTemplate =\n isVueVirtual &&\n (query!.type === 'template' ||\n (query!.type === 'script' && query!.setup === 'true'))\n\n if (isVueFile || isVueTemplate) {\n const { code: importCode, source } = generateImports(code, importOptions)\n return { code: source + importCode, map: null }\n }\n\n return null\n },\n }\n}\n","import { camelize, capitalize } from 'vue'\n\nexport interface TemplateMatch {\n /** The local JS symbol name, e.g. `_component_VBtn` */\n symbol: string\n /** PascalCase component/directive name, e.g. `VBtn` */\n name: string\n /** Byte offset of the match inside the source string */\n index: number\n /** Byte length of the matched substring */\n length: number\n}\n\n/**\n * Parse compiled Vue template code for `_resolveComponent(...)` and\n * `_resolveDirective(...)` calls and return typed match sets.\n *\n * The regex patterns mirror those in `@vuetify/loader-shared` exactly so\n * behaviour is identical.\n */\nexport function parseTemplate (source: string) {\n const components = collectMatches(\n source.matchAll(/(?:var|const) (\\w+) *?= *?_resolveComponent\\(\"([\\w-.]+)\"\\);?/gm)\n )\n const directives = collectMatches(\n source.matchAll(/(?:var|const) (\\w+) *?= *?_resolveDirective\\(\"([\\w-.]+)\"\\);?/gm)\n )\n return { components, directives }\n}\n\nfunction collectMatches (\n iter: IterableIterator<RegExpMatchArray>\n): Set<TemplateMatch> {\n return new Set(\n Array.from(iter, m => ({\n symbol: m[1],\n name: capitalize(camelize(m[2])),\n index: m.index!,\n length: m[0].length,\n }))\n )\n}\n","import { createRequire } from 'node:module'\nimport nodePath from 'node:path'\n\n// `__filename` is available in both output formats:\n// - CJS: provided natively by Node\n// - ESM: shimmed from `import.meta.url` via the tsup banner\nconst _require = createRequire(__filename)\n\n/**\n * Resolves the directory of the installed `vuetify` package.\n */\nexport function resolveVuetifyBase (): string {\n return nodePath.dirname(\n _require.resolve('vuetify/package.json', { paths: [process.cwd()] })\n )\n}\n\nexport function loadImportMap () {\n return _require('vuetify/dist/json/importMap.json') as ImportMap\n}\n\nexport function loadImportMapLabs () {\n return _require('vuetify/dist/json/importMap-labs.json') as ImportMap\n}\n\nexport interface ImportMap {\n components: Record<string, { from: string }>\n directives: string[]\n}\n\n/** Forward-slash paths on Windows for Vite/esbuild compatibility. */\nexport function normalizePath (p: string): string {\n p = nodePath.normalize(p).replace(/\\\\/g, '/')\n if (/^[a-z]:\\//i.test(p)) p = '/' + p\n return p\n}\n\nexport function isObject (value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object'\n}\n\nexport function isSubdir (root: string, test: string): boolean {\n const rel = nodePath.relative(root, test)\n return !!rel && !rel.startsWith('..') && !nodePath.isAbsolute(rel)\n}\n","import { parseTemplate } from './parseTemplate'\nimport { loadImportMap, loadImportMapLabs } from '../utils'\nimport type { TemplateMatch } from './parseTemplate'\nimport type { ImportPluginOptions } from '../types'\n\n/**\n * Given compiled Vue template source, returns:\n * - `imports` Map<from-specifier, [\"Name as _symbol\", ...]>\n * - `components` matched component descriptors (for source-rewriting)\n * - `directives` matched directive descriptors (for source-rewriting)\n */\nexport function getImports (source: string, options: ImportPluginOptions) {\n const importMap = loadImportMap()\n const importMapLabs = loadImportMapLabs()\n\n const { components, directives } = parseTemplate(source)\n const resolvedComponents: TemplateMatch[] = []\n const resolvedDirectives: TemplateMatch[] = []\n const imports = new Map<string, string[]>()\n\n const ignore = options.ignore ?? null\n const includeLabs = !!options.labs\n\n // Merge labs into the lookup when requested\n const componentMap: Record<string, { from: string }> = includeLabs\n ? { ...importMap.components, ...importMapLabs.components }\n : { ...importMap.components }\n\n components.forEach(c => {\n if (ignore?.includes(c.name as never)) return\n if (c.name in componentMap) resolvedComponents.push(c)\n })\n\n directives.forEach(d => {\n if (importMap.directives.includes(d.name) && !ignore?.includes(d.name as never)) {\n resolvedDirectives.push(d)\n }\n })\n\n resolvedComponents.forEach(c => {\n const { from } = componentMap[c.name]\n // Vuetify ≥3.7.11 / v4: `from` ends in `.mjs` and is a subpath export.\n // Older builds use a bare lib path.\n const specifier = from.endsWith('.mjs') ? `vuetify/lib/${from}` : `vuetify/${from}`\n addImport(imports, c.name, c.symbol, specifier)\n })\n\n resolvedDirectives.forEach(d => {\n addImport(imports, d.name, d.symbol, 'vuetify/directives')\n })\n\n return { imports, components: resolvedComponents, directives: resolvedDirectives }\n}\n\nfunction addImport (\n imports: Map<string, string[]>,\n name: string,\n as: string,\n from: string\n) {\n if (!imports.has(from)) imports.set(from, [])\n imports.get(from)!.push(`${name} as ${as}`)\n}\n","import { getImports } from './getImports'\nimport type { ImportPluginOptions } from '../types'\n\n/**\n * Core transform: given compiled Vue template `source`, generates static\n * Vuetify import statements and erases the `_resolveComponent(...)` /\n * `_resolveDirective(...)` declarations those imports replace.\n *\n * Returns `{ code, source }` where:\n * - `source` is the (possibly mutated) original code with dynamic-resolve\n * calls blanked out (spaces, preserving source-map columns).\n * - `code` is the new import block to prepend / append.\n */\nexport function generateImports (\n source: string,\n options: ImportPluginOptions\n): { code: string; source: string } {\n const { imports, components, directives } = getImports(source, options)\n\n let code = ''\n\n if (components.length || directives.length) {\n code += '\\n\\n/* Vuetify */\\n'\n\n // Sort import specifiers alphabetically for deterministic output\n Array.from(imports)\n .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))\n .forEach(([from, names]) => {\n code += `import { ${names.join(', ')} } from \"${from}\"\\n`\n })\n\n code += '\\n'\n\n // Replace matched substrings with spaces to preserve source-map columns\n source = [...components, ...directives].reduce((acc, v) => {\n return acc.slice(0, v.index) + ' '.repeat(v.length) + acc.slice(v.index + v.length)\n }, source)\n\n // If all resolveComponent / resolveDirective calls are gone, also strip\n // the named imports from the Vue runtime import at the top of the file.\n if (!source.includes('_resolveComponent(')) {\n source = source.replace('resolveComponent as _resolveComponent, ', '')\n }\n if (!source.includes('_resolveDirective(')) {\n source = source.replace('resolveDirective as _resolveDirective, ', '')\n }\n }\n\n return { code, source }\n}\n","import nodePath from 'node:path'\nimport fs from 'node:fs/promises'\nimport { resolveVuetifyBase, normalizePath, isObject, isSubdir } from './utils'\nimport type { Plugin, ResolvedConfig } from 'vite'\nimport type { ResolvedOptions, StylesConfigFile } from './types'\n\nconst VIRTUAL_PREFIX = 'virtual:'\nconst PLUGIN_VIRTUAL_NAME = 'plugin-vuetify4'\nconst VIRTUAL_MODULE_ID = `${VIRTUAL_PREFIX}${PLUGIN_VIRTUAL_NAME}`\n\n/**\n * `vuetify4:styles`\n *\n * Intercepts Vuetify's internal `.css` imports and redirects them according to\n * `options.styles`:\n *\n * - `'none'` → return empty module (suppress all Vuetify CSS)\n * - `'sass'` → resolve to the companion `.sass` / `.scss` source\n * - `{ configFile }` → prefix every component stylesheet with `@use configFile`\n *\n * When `styles: true` (default), this plugin is not added at all — Vite\n * handles the pre-compiled CSS normally.\n */\nexport function stylesPlugin (options: ResolvedOptions): Plugin {\n const vuetifyBase = resolveVuetifyBase()\n\n let configFile = ''\n // Virtual file contents keyed by relative path (configFile strategy)\n const tempFiles = new Map<string, string>()\n // Cache css → sass/scss path resolutions\n const cssToSass = new Map<string, string>()\n\n async function resolveSass (target: string): Promise<string> {\n let cached = cssToSass.get(target)\n if (!cached) {\n cached = target.replace(/\\.css$/, '.sass')\n try {\n await fs.access(cached, fs.constants.R_OK)\n } catch (err) {\n // Fallback to .scss\n if (err instanceof Error && 'code' in err && (err as NodeJS.ErrnoException).code === 'ENOENT') {\n cached = target.replace(/\\.css$/, '.scss')\n } else {\n throw err\n }\n }\n cssToSass.set(target, cached)\n }\n return cached\n }\n\n return {\n name: 'vuetify4:styles',\n enforce: 'pre', // Must run before Vite's default CSS resolution\n\n configResolved (config: ResolvedConfig) {\n if (isObject(options.styles) && 'configFile' in options.styles) {\n const cf = (options.styles as StylesConfigFile).configFile\n configFile = nodePath.isAbsolute(cf)\n ? cf\n : nodePath.join(config.root || process.cwd(), cf)\n }\n },\n\n async resolveId (source, importer, ctx) {\n const isVuetifyStyles =\n source === 'vuetify/styles' ||\n (\n importer &&\n source.endsWith('.css') &&\n isSubdir(\n vuetifyBase,\n nodePath.isAbsolute(source) ? source : importer\n )\n )\n\n if (isVuetifyStyles) {\n // ── Strategy: none ────────────────────────────────────────────────────\n if (options.styles === 'none') {\n return `${VIRTUAL_PREFIX}__void__`\n }\n\n // ── Strategy: sass ────────────────────────────────────────────────────\n if (options.styles === 'sass') {\n const resolution = await this.resolve(source, importer, {\n skipSelf: true,\n custom: ctx.custom,\n })\n if (!resolution) return null\n return resolveSass(resolution.id)\n }\n\n // ── Strategy: { configFile } ──────────────────────────────────────────\n if (isObject(options.styles) && 'configFile' in options.styles) {\n const resolution = await this.resolve(source, importer, {\n skipSelf: true,\n custom: ctx.custom,\n })\n if (!resolution) return null\n\n const sassFile = await resolveSass(resolution.id)\n const relFile = nodePath.relative(nodePath.join(vuetifyBase, 'lib'), sassFile)\n const suffix = sassFile.endsWith('.scss') ? ';\\n' : '\\n'\n const contents =\n `@use \"${normalizePath(configFile)}\"${suffix}` +\n `@use \"${normalizePath(sassFile)}\"${suffix}`\n\n tempFiles.set(relFile, contents)\n return `${VIRTUAL_MODULE_ID}:${relFile}`\n }\n }\n\n // ── Vite SSR virtual re-entry aliases ─────────────────────────────────\n if (source.startsWith(`/${PLUGIN_VIRTUAL_NAME}:`)) {\n return VIRTUAL_PREFIX + source.slice(1)\n }\n if (source.startsWith(`/@id/__x00__${PLUGIN_VIRTUAL_NAME}:`)) {\n return VIRTUAL_PREFIX + source.slice(12)\n }\n if (source.startsWith(`/${VIRTUAL_MODULE_ID}:`)) {\n return source.slice(1)\n }\n\n return null\n },\n\n load (id) {\n // __void__ — suppress CSS (styles: 'none')\n // Vite may append a version hash: `?v=abc123`\n if (new RegExp(`^${VIRTUAL_PREFIX}__void__(\\\\?.*)?$`).test(id)) {\n return ''\n }\n\n // Virtual config-prefixed sass files\n if (id.startsWith(VIRTUAL_MODULE_ID)) {\n const file = new RegExp(`^${VIRTUAL_MODULE_ID}:(.*?)(\\\\?.*)?$`).exec(id)?.[1]\n if (file) return tempFiles.get(file) ?? null\n }\n\n return null\n },\n }\n}\n","import type { Plugin } from 'vite'\nimport { resolveOptions } from './types'\nimport { importPlugin } from './importPlugin'\nimport { stylesPlugin } from './stylesPlugin'\nimport type { Options } from './types'\n\n// ─── transformAssetUrls ───────────────────────────────────────────────────────\n// Tells @vitejs/plugin-vue which Vuetify component props carry asset URLs\n// (images, posters, etc.) so Vite can process them as static assets.\n// Mirrors the official plugin's export exactly.\n\nfunction toKebabCase (str = '') {\n return str\n .replace(/[^a-z]/gi, '-')\n .replace(/\\B([A-Z])/g, '-$1')\n .toLowerCase()\n}\n\nconst _transformAssetUrls: Record<string, string[]> = {\n VAppBar: ['image'],\n VAvatar: ['image'],\n VBanner: ['avatar'],\n VCard: ['image', 'prependAvatar', 'appendAvatar'],\n VCardItem: ['prependAvatar', 'appendAvatar'],\n VCarouselItem: ['src', 'lazySrc', 'srcset'],\n VChip: ['prependAvatar', 'appendAvatar'],\n VImg: ['src', 'lazySrc', 'srcset'],\n VListItem: ['prependAvatar', 'appendAvatar'],\n VNavigationDrawer:['image'],\n VParallax: ['src', 'lazySrc', 'srcset'],\n VToolbar: ['image'],\n}\n\n// Add kebab-case aliases and default HTML tag attrs\nfor (const [tag, attrs] of Object.entries(_transformAssetUrls)) {\n attrs.forEach(attr => {\n if (/[A-Z]/.test(attr)) attrs.push(toKebabCase(attr))\n })\n _transformAssetUrls[toKebabCase(tag)] = attrs\n}\nObject.assign(_transformAssetUrls, {\n video: ['src', 'poster'],\n source: ['src'],\n img: ['src'],\n image: ['xlink:href', 'href'],\n use: ['xlink:href', 'href'],\n})\n\nexport const transformAssetUrls = _transformAssetUrls\n\n// ─── Main plugin factory ──────────────────────────────────────────────────────\n\n/**\n * `vite-plugin-vuetify4`\n *\n * Drop-in Vite plugin for Vuetify 4 with:\n * - Tree-shaking auto-import (no `@vuetify/loader-shared` dependency)\n * - CSS / SASS / configFile style strategies\n * - Lab component support\n * - `transformAssetUrls` for @vitejs/plugin-vue\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { defineConfig } from 'vite'\n * import vue from '@vitejs/plugin-vue'\n * import vuetify from 'vite-plugin-vuetify4'\n *\n * export default defineConfig({\n * plugins: [\n * vue({ template: { transformAssetUrls: vuetify.transformAssetUrls } }),\n * vuetify({ styles: { configFile: 'src/styles/settings.scss' } }),\n * ],\n * })\n * ```\n */\nfunction vuetify (rawOptions: Options = {}): Plugin[] {\n const options = resolveOptions(rawOptions)\n const plugins: Plugin[] = []\n\n if (options.autoImport !== false) {\n plugins.push(importPlugin(options))\n }\n\n // Style plugin is only needed for non-default strategies\n if (\n options.styles === 'none' ||\n options.styles === 'sass' ||\n (typeof options.styles === 'object' && 'configFile' in options.styles)\n ) {\n plugins.push(stylesPlugin(options))\n }\n\n return plugins\n}\n\nvuetify.transformAssetUrls = transformAssetUrls\n\nexport default vuetify\n\n// Named exports for Nuxt module / programmatic usage\nexport type { Options, ImportPluginOptions, StylesOption, StylesConfigFile, ResolvedOptions } from './types'\nexport { importPlugin } from './importPlugin'\nexport { stylesPlugin } from './stylesPlugin'\nexport { generateImports } from './imports/generateImports'\nexport { parseTemplate } from './imports/parseTemplate'\n"],"mappings":";;;;AAmEO,SAAS,eAAgB,KAA+B;AAC7D,QAAM,aACJ,IAAI,eAAe,QACf,QACA,IAAI,eAAe,QAAQ,IAAI,cAAc,OAC7C,CAAC,IACD,IAAI;AAEV,SAAO;AAAA,IACL;AAAA,IACA,QAAQ,IAAI,UAAU;AAAA,EACxB;AACF;;;AC/EA,SAAS,oBAAoB;;;ACA7B,SAAS,UAAU,kBAAkB;AAoB9B,SAAS,cAAe,QAAgB;AAC7C,QAAM,aAAa;AAAA,IACjB,OAAO,SAAS,gEAAgE;AAAA,EAClF;AACA,QAAM,aAAa;AAAA,IACjB,OAAO,SAAS,gEAAgE;AAAA,EAClF;AACA,SAAO,EAAE,YAAY,WAAW;AAClC;AAEA,SAAS,eACP,MACoB;AACpB,SAAO,IAAI;AAAA,IACT,MAAM,KAAK,MAAM,QAAM;AAAA,MACrB,QAAQ,EAAE,CAAC;AAAA,MACX,MAAQ,WAAW,SAAS,EAAE,CAAC,CAAC,CAAC;AAAA,MACjC,OAAQ,EAAE;AAAA,MACV,QAAQ,EAAE,CAAC,EAAE;AAAA,IACf,EAAE;AAAA,EACJ;AACF;;;ACzCA,SAAS,qBAAqB;AAC9B,OAAO,cAAc;AAKrB,IAAM,WAAW,cAAc,UAAU;AAKlC,SAAS,qBAA8B;AAC5C,SAAO,SAAS;AAAA,IACd,SAAS,QAAQ,wBAAwB,EAAE,OAAO,CAAC,QAAQ,IAAI,CAAC,EAAE,CAAC;AAAA,EACrE;AACF;AAEO,SAAS,gBAAiB;AAC/B,SAAO,SAAS,kCAAkC;AACpD;AAEO,SAAS,oBAAqB;AACnC,SAAO,SAAS,uCAAuC;AACzD;AAQO,SAAS,cAAe,GAAmB;AAChD,MAAI,SAAS,UAAU,CAAC,EAAE,QAAQ,OAAO,GAAG;AAC5C,MAAI,aAAa,KAAK,CAAC,EAAG,KAAI,MAAM;AACpC,SAA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M,IAAM,qBAAqB;AA4BlC,SAAS,QAAS,aAAsB,CAAC,GAAa;AACpD,QAAM,UAAU,eAAe,UAAU;AACzC,QAAM,UAAoB,CAAC;AAE3B,MAAI,QAAQ,eAAe,OAAO;AAChC,YAAQ,KAAK,aAAa,OAAO,CAAC;AAAA,EACpC;AAGA,MACE,QAAQ,WAAW,UACnB,QAAQ,WAAW,UAClB,OAAO,QAAQ,WAAW,YAAY,gBAAgB,QAAQ,QAC/D;AACA,YAAQ,KAAK,aAAa,OAAO,CAAC;AAAA,EACpC;AAEA,SAAO;AACT;AAEA,QAAQ,qBAAqB;AAE7B,IAAO,gBAAQ;","names":["nodePath","nodePath"]}
|
|
1
|
+
{"version":3,"sources":["../src/types.ts","../src/importPlugin.ts","../src/imports/parseTemplate.ts","../src/utils.ts","../src/imports/getImports.ts","../src/imports/generateImports.ts","../src/stylesPlugin.ts","../src/index.ts"],"sourcesContent":["import type * as Components from 'vuetify/components'\nimport type * as Directives from 'vuetify/directives'\n\n// ─── Auto-import options ──────────────────────────────────────────────────────\n\nexport interface ImportPluginOptions {\n /**\n * Include Vuetify Labs components (`vuetify/labs/*`).\n * @default false\n */\n labs?: boolean\n /**\n * Component or directive names to exclude from auto-import.\n * Useful when you want to manually register a component with a custom impl.\n */\n ignore?: (keyof typeof Components | keyof typeof Directives)[]\n}\n\n// ─── Styles options ───────────────────────────────────────────────────────────\n\nexport interface StylesConfigFile {\n /**\n * Path to a SASS/SCSS config file that is @use-d before every Vuetify\n * component stylesheet. Relative to `vite.config` root, or absolute.\n *\n * Example:\n * ```ts\n * styles: { configFile: 'src/styles/vuetify-settings.scss' }\n * ```\n */\n configFile: string\n}\n\n/**\n * How to handle Vuetify stylesheets:\n * - `true` — use the pre-compiled CSS (default, fastest)\n * - `'none'` — suppress all Vuetify CSS (you bring your own)\n * - `'sass'` — use the raw SASS/SCSS sources (requires sass)\n * - `{ configFile }` — use SASS sources prefixed with your settings file\n */\nexport type StylesOption = true | 'none' | 'sass' | StylesConfigFile\n\n// ─── Top-level options ────────────────────────────────────────────────────────\n\nexport interface Options {\n /**\n * Enable/configure component + directive auto-import with tree-shaking.\n * - `true` — auto-import everything (default)\n * - `false` — disable (you import manually or use a full bundle)\n * - `{ labs, ignore }` — fine-grained control\n */\n autoImport?: boolean | ImportPluginOptions\n\n /**\n * Stylesheet handling strategy.\n * @default true\n */\n styles?: StylesOption\n}\n\n// ─── Internal resolved types ──────────────────────────────────────────────────\n\nexport interface ResolvedOptions {\n autoImport: false | ImportPluginOptions\n styles: StylesOption\n}\n\nexport function resolveOptions (raw: Options): ResolvedOptions {\n const autoImport: ResolvedOptions['autoImport'] =\n raw.autoImport === false\n ? false\n : raw.autoImport === true || raw.autoImport == null\n ? {}\n : raw.autoImport\n\n return {\n autoImport,\n styles: raw.styles ?? true,\n }\n}\n","import { createFilter } from 'vite'\nimport type { Plugin, ResolvedConfig } from 'vite'\nimport { generateImports } from './imports/generateImports'\nimport type { ResolvedOptions } from './types'\n\nfunction parseId (id: string) {\n const [pathname, query] = id.split('?')\n return {\n path: pathname ?? id,\n query: query ? Object.fromEntries(new URLSearchParams(query)) : null,\n }\n}\n\n/**\n * `vuetify4:import`\n *\n * Intercepts every compiled Vue file / template chunk and replaces dynamic\n * `_resolveComponent(...)` calls with static tree-shakeable imports from the\n * Vuetify package.\n *\n * Must be placed AFTER the Vue plugin in the plugins array (enforced at\n * `configResolved` time).\n */\nexport function importPlugin (options: ResolvedOptions): Plugin {\n // Narrowed: if we reach here, autoImport is not false\n const importOptions = options.autoImport as Exclude<ResolvedOptions['autoImport'], false>\n let filter: (id: unknown) => boolean = () => true\n\n return {\n name: 'vuetify4:import',\n\n configResolved (config: ResolvedConfig) {\n const selfIdx = config.plugins.findIndex(p => p.name === 'vuetify4:import')\n const vueIdx = config.plugins.findIndex(p =>\n ['vite:vue', 'unplugin-vue'].includes(p.name)\n )\n\n if (vueIdx === -1) {\n config.logger.warn(\n '[vuetify-vite-plugin] No Vue plugin found — ' +\n 'auto-import is a no-op. Add @vitejs/plugin-vue ' +\n '(Nuxt provides this automatically).'\n )\n return\n }\n\n if (selfIdx !== -1 && selfIdx < vueIdx) {\n throw new Error(\n '[vuetify-vite-plugin] This plugin must be registered AFTER the Vue plugin. ' +\n 'Move it below `vue()` in your plugins array.'\n )\n }\n\n const vuePlugin = config.plugins[vueIdx] as any\n const vueOptions = vuePlugin?.api?.options ?? {}\n filter = createFilter(vueOptions.include, vueOptions.exclude)\n },\n\n transform (code, id) {\n const { path, query } = parseId(id)\n\n // A virtual sub-request appended by the Vue plugin (e.g. ?vue&type=template)\n const isVueVirtual = !!query && 'vue' in query\n const isVueFile =\n !isVueVirtual &&\n filter(path) &&\n // Skip render-only re-export stubs that the Vue plugin emits\n !/^import \\{ render as _sfc_render \\} from \".*\"$/m.test(code)\n const isVueTemplate =\n isVueVirtual &&\n (query!.type === 'template' ||\n (query!.type === 'script' && query!.setup === 'true'))\n\n if (isVueFile || isVueTemplate) {\n const { code: importCode, source } = generateImports(code, importOptions)\n return { code: source + importCode, map: null }\n }\n\n return null\n },\n }\n}\n","import { camelize, capitalize } from 'vue'\n\nexport interface TemplateMatch {\n /** The local JS symbol name, e.g. `_component_VBtn` */\n symbol: string\n /** PascalCase component/directive name, e.g. `VBtn` */\n name: string\n /** Byte offset of the match inside the source string */\n index: number\n /** Byte length of the matched substring */\n length: number\n}\n\n/**\n * Parse compiled Vue template code for `_resolveComponent(...)` and\n * `_resolveDirective(...)` calls and return typed match sets.\n *\n * The regex patterns mirror those in `@vuetify/loader-shared` exactly so\n * behaviour is identical.\n */\nexport function parseTemplate (source: string) {\n const components = collectMatches(\n source.matchAll(/(?:var|const) (\\w+) *?= *?_resolveComponent\\(\"([\\w-.]+)\"\\);?/gm)\n )\n const directives = collectMatches(\n source.matchAll(/(?:var|const) (\\w+) *?= *?_resolveDirective\\(\"([\\w-.]+)\"\\);?/gm)\n )\n return { components, directives }\n}\n\nfunction collectMatches (\n iter: IterableIterator<RegExpMatchArray>\n): Set<TemplateMatch> {\n return new Set(\n Array.from(iter, m => ({\n symbol: m[1],\n name: capitalize(camelize(m[2])),\n index: m.index!,\n length: m[0].length,\n }))\n )\n}\n","import { createRequire } from 'node:module'\nimport nodePath from 'node:path'\n\n// `__filename` is available in both output formats:\n// - CJS: provided natively by Node\n// - ESM: shimmed from `import.meta.url` via the tsup banner\nconst _require = createRequire(__filename)\n\n/**\n * Resolves the directory of the installed `vuetify` package.\n */\nexport function resolveVuetifyBase (): string {\n return nodePath.dirname(\n _require.resolve('vuetify/package.json', { paths: [process.cwd()] })\n )\n}\n\nexport function loadImportMap () {\n return _require('vuetify/dist/json/importMap.json') as ImportMap\n}\n\nexport function loadImportMapLabs () {\n return _require('vuetify/dist/json/importMap-labs.json') as ImportMap\n}\n\nexport interface ImportMap {\n components: Record<string, { from: string }>\n directives: string[]\n}\n\n/** Forward-slash paths on Windows for Vite/esbuild compatibility. */\nexport function normalizePath (p: string): string {\n p = nodePath.normalize(p).replace(/\\\\/g, '/')\n if (/^[a-z]:\\//i.test(p)) p = '/' + p\n return p\n}\n\nexport function isObject (value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object'\n}\n\nexport function isSubdir (root: string, test: string): boolean {\n const rel = nodePath.relative(root, test)\n return !!rel && !rel.startsWith('..') && !nodePath.isAbsolute(rel)\n}\n","import { parseTemplate } from './parseTemplate'\nimport { loadImportMap, loadImportMapLabs } from '../utils'\nimport type { TemplateMatch } from './parseTemplate'\nimport type { ImportPluginOptions } from '../types'\n\n/**\n * Given compiled Vue template source, returns:\n * - `imports` Map<from-specifier, [\"Name as _symbol\", ...]>\n * - `components` matched component descriptors (for source-rewriting)\n * - `directives` matched directive descriptors (for source-rewriting)\n */\nexport function getImports (source: string, options: ImportPluginOptions) {\n const importMap = loadImportMap()\n const importMapLabs = loadImportMapLabs()\n\n const { components, directives } = parseTemplate(source)\n const resolvedComponents: TemplateMatch[] = []\n const resolvedDirectives: TemplateMatch[] = []\n const imports = new Map<string, string[]>()\n\n const ignore = options.ignore ?? null\n const includeLabs = !!options.labs\n\n // Merge labs into the lookup when requested\n const componentMap: Record<string, { from: string }> = includeLabs\n ? { ...importMap.components, ...importMapLabs.components }\n : { ...importMap.components }\n\n components.forEach(c => {\n if (ignore?.includes(c.name as never)) return\n if (c.name in componentMap) resolvedComponents.push(c)\n })\n\n directives.forEach(d => {\n if (importMap.directives.includes(d.name) && !ignore?.includes(d.name as never)) {\n resolvedDirectives.push(d)\n }\n })\n\n resolvedComponents.forEach(c => {\n const { from } = componentMap[c.name]\n // Vuetify ≥3.7.11 / v4: `from` ends in `.mjs` and is a subpath export.\n // Older builds use a bare lib path.\n const specifier = from.endsWith('.mjs') ? `vuetify/lib/${from}` : `vuetify/${from}`\n addImport(imports, c.name, c.symbol, specifier)\n })\n\n resolvedDirectives.forEach(d => {\n addImport(imports, d.name, d.symbol, 'vuetify/directives')\n })\n\n return { imports, components: resolvedComponents, directives: resolvedDirectives }\n}\n\nfunction addImport (\n imports: Map<string, string[]>,\n name: string,\n as: string,\n from: string\n) {\n if (!imports.has(from)) imports.set(from, [])\n imports.get(from)!.push(`${name} as ${as}`)\n}\n","import { getImports } from './getImports'\nimport type { ImportPluginOptions } from '../types'\n\n/**\n * Core transform: given compiled Vue template `source`, generates static\n * Vuetify import statements and erases the `_resolveComponent(...)` /\n * `_resolveDirective(...)` declarations those imports replace.\n *\n * Returns `{ code, source }` where:\n * - `source` is the (possibly mutated) original code with dynamic-resolve\n * calls blanked out (spaces, preserving source-map columns).\n * - `code` is the new import block to prepend / append.\n */\nexport function generateImports (\n source: string,\n options: ImportPluginOptions\n): { code: string; source: string } {\n const { imports, components, directives } = getImports(source, options)\n\n let code = ''\n\n if (components.length || directives.length) {\n code += '\\n\\n/* Vuetify */\\n'\n\n // Sort import specifiers alphabetically for deterministic output\n Array.from(imports)\n .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))\n .forEach(([from, names]) => {\n code += `import { ${names.join(', ')} } from \"${from}\"\\n`\n })\n\n code += '\\n'\n\n // Replace matched substrings with spaces to preserve source-map columns\n source = [...components, ...directives].reduce((acc, v) => {\n return acc.slice(0, v.index) + ' '.repeat(v.length) + acc.slice(v.index + v.length)\n }, source)\n\n // If all resolveComponent / resolveDirective calls are gone, also strip\n // the named imports from the Vue runtime import at the top of the file.\n if (!source.includes('_resolveComponent(')) {\n source = source.replace('resolveComponent as _resolveComponent, ', '')\n }\n if (!source.includes('_resolveDirective(')) {\n source = source.replace('resolveDirective as _resolveDirective, ', '')\n }\n }\n\n return { code, source }\n}\n","import nodePath from 'node:path'\nimport fs from 'node:fs/promises'\nimport { resolveVuetifyBase, normalizePath, isObject, isSubdir } from './utils'\nimport type { Plugin, ResolvedConfig } from 'vite'\nimport type { ResolvedOptions, StylesConfigFile } from './types'\n\nconst VIRTUAL_PREFIX = 'virtual:'\nconst PLUGIN_VIRTUAL_NAME = 'plugin-vuetify4'\nconst VIRTUAL_MODULE_ID = `${VIRTUAL_PREFIX}${PLUGIN_VIRTUAL_NAME}`\n\n/**\n * `vuetify4:styles`\n *\n * Intercepts Vuetify's internal `.css` imports and redirects them according to\n * `options.styles`:\n *\n * - `'none'` → return empty module (suppress all Vuetify CSS)\n * - `'sass'` → resolve to the companion `.sass` / `.scss` source\n * - `{ configFile }` → prefix every component stylesheet with `@use configFile`\n *\n * When `styles: true` (default), this plugin is not added at all — Vite\n * handles the pre-compiled CSS normally.\n */\nexport function stylesPlugin (options: ResolvedOptions): Plugin {\n const vuetifyBase = resolveVuetifyBase()\n\n let configFile = ''\n // Virtual file contents keyed by relative path (configFile strategy)\n const tempFiles = new Map<string, string>()\n // Cache css → sass/scss path resolutions\n const cssToSass = new Map<string, string>()\n\n async function resolveSass (target: string): Promise<string> {\n let cached = cssToSass.get(target)\n if (!cached) {\n cached = target.replace(/\\.css$/, '.sass')\n try {\n await fs.access(cached, fs.constants.R_OK)\n } catch (err) {\n // Fallback to .scss\n if (err instanceof Error && 'code' in err && (err as NodeJS.ErrnoException).code === 'ENOENT') {\n cached = target.replace(/\\.css$/, '.scss')\n } else {\n throw err\n }\n }\n cssToSass.set(target, cached)\n }\n return cached\n }\n\n return {\n name: 'vuetify4:styles',\n enforce: 'pre', // Must run before Vite's default CSS resolution\n\n configResolved (config: ResolvedConfig) {\n if (isObject(options.styles) && 'configFile' in options.styles) {\n const cf = (options.styles as StylesConfigFile).configFile\n configFile = nodePath.isAbsolute(cf)\n ? cf\n : nodePath.join(config.root || process.cwd(), cf)\n }\n },\n\n async resolveId (source, importer, ctx) {\n const isVuetifyStyles =\n source === 'vuetify/styles' ||\n (\n importer &&\n source.endsWith('.css') &&\n isSubdir(\n vuetifyBase,\n nodePath.isAbsolute(source) ? source : importer\n )\n )\n\n if (isVuetifyStyles) {\n // ── Strategy: none ────────────────────────────────────────────────────\n if (options.styles === 'none') {\n return `${VIRTUAL_PREFIX}__void__`\n }\n\n // ── Strategy: sass ────────────────────────────────────────────────────\n if (options.styles === 'sass') {\n const resolution = await this.resolve(source, importer, {\n skipSelf: true,\n custom: ctx.custom,\n })\n if (!resolution) return null\n return resolveSass(resolution.id)\n }\n\n // ── Strategy: { configFile } ──────────────────────────────────────────\n if (isObject(options.styles) && 'configFile' in options.styles) {\n const resolution = await this.resolve(source, importer, {\n skipSelf: true,\n custom: ctx.custom,\n })\n if (!resolution) return null\n\n const sassFile = await resolveSass(resolution.id)\n const relFile = nodePath.relative(nodePath.join(vuetifyBase, 'lib'), sassFile)\n const suffix = sassFile.endsWith('.scss') ? ';\\n' : '\\n'\n const contents =\n `@use \"${normalizePath(configFile)}\"${suffix}` +\n `@use \"${normalizePath(sassFile)}\"${suffix}`\n\n tempFiles.set(relFile, contents)\n return `${VIRTUAL_MODULE_ID}:${relFile}`\n }\n }\n\n // ── Vite SSR virtual re-entry aliases ─────────────────────────────────\n if (source.startsWith(`/${PLUGIN_VIRTUAL_NAME}:`)) {\n return VIRTUAL_PREFIX + source.slice(1)\n }\n if (source.startsWith(`/@id/__x00__${PLUGIN_VIRTUAL_NAME}:`)) {\n return VIRTUAL_PREFIX + source.slice(12)\n }\n if (source.startsWith(`/${VIRTUAL_MODULE_ID}:`)) {\n return source.slice(1)\n }\n\n return null\n },\n\n load (id) {\n // __void__ — suppress CSS (styles: 'none')\n // Vite may append a version hash: `?v=abc123`\n if (new RegExp(`^${VIRTUAL_PREFIX}__void__(\\\\?.*)?$`).test(id)) {\n return ''\n }\n\n // Virtual config-prefixed sass files\n if (id.startsWith(VIRTUAL_MODULE_ID)) {\n const file = new RegExp(`^${VIRTUAL_MODULE_ID}:(.*?)(\\\\?.*)?$`).exec(id)?.[1]\n if (file) return tempFiles.get(file) ?? null\n }\n\n return null\n },\n }\n}\n","import type { Plugin } from 'vite'\nimport { resolveOptions } from './types'\nimport { importPlugin } from './importPlugin'\nimport { stylesPlugin } from './stylesPlugin'\nimport type { Options } from './types'\n\n// ─── transformAssetUrls ───────────────────────────────────────────────────────\n// Tells @vitejs/plugin-vue which Vuetify component props carry asset URLs\n// (images, posters, etc.) so Vite can process them as static assets.\n// Mirrors the official plugin's export exactly.\n\nfunction toKebabCase (str = '') {\n return str\n .replace(/[^a-z]/gi, '-')\n .replace(/\\B([A-Z])/g, '-$1')\n .toLowerCase()\n}\n\nconst _transformAssetUrls: Record<string, string[]> = {\n VAppBar: ['image'],\n VAvatar: ['image'],\n VBanner: ['avatar'],\n VCard: ['image', 'prependAvatar', 'appendAvatar'],\n VCardItem: ['prependAvatar', 'appendAvatar'],\n VCarouselItem: ['src', 'lazySrc', 'srcset'],\n VChip: ['prependAvatar', 'appendAvatar'],\n VImg: ['src', 'lazySrc', 'srcset'],\n VListItem: ['prependAvatar', 'appendAvatar'],\n VNavigationDrawer:['image'],\n VParallax: ['src', 'lazySrc', 'srcset'],\n VToolbar: ['image'],\n}\n\n// Add kebab-case aliases and default HTML tag attrs\nfor (const [tag, attrs] of Object.entries(_transformAssetUrls)) {\n attrs.forEach(attr => {\n if (/[A-Z]/.test(attr)) attrs.push(toKebabCase(attr))\n })\n _transformAssetUrls[toKebabCase(tag)] = attrs\n}\nObject.assign(_transformAssetUrls, {\n video: ['src', 'poster'],\n source: ['src'],\n img: ['src'],\n image: ['xlink:href', 'href'],\n use: ['xlink:href', 'href'],\n})\n\nexport const transformAssetUrls = _transformAssetUrls\n\n// ─── Main plugin factory ──────────────────────────────────────────────────────\n\n/**\n * `vuetify-vite-plugin`\n *\n * Drop-in Vite plugin for Vuetify 4 with:\n * - Tree-shaking auto-import (no `@vuetify/loader-shared` dependency)\n * - CSS / SASS / configFile style strategies\n * - Lab component support\n * - `transformAssetUrls` for @vitejs/plugin-vue\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { defineConfig } from 'vite'\n * import vue from '@vitejs/plugin-vue'\n * import vuetify from 'vuetify-vite-plugin'\n *\n * export default defineConfig({\n * plugins: [\n * vue({ template: { transformAssetUrls: vuetify.transformAssetUrls } }),\n * vuetify({ styles: { configFile: 'src/styles/settings.scss' } }),\n * ],\n * })\n * ```\n */\nfunction vuetify (rawOptions: Options = {}): Plugin[] {\n const options = resolveOptions(rawOptions)\n const plugins: Plugin[] = []\n\n if (options.autoImport !== false) {\n plugins.push(importPlugin(options))\n }\n\n // Style plugin is only needed for non-default strategies\n if (\n options.styles === 'none' ||\n options.styles === 'sass' ||\n (typeof options.styles === 'object' && 'configFile' in options.styles)\n ) {\n plugins.push(stylesPlugin(options))\n }\n\n return plugins\n}\n\nvuetify.transformAssetUrls = transformAssetUrls\n\nexport default vuetify\n\n// Named exports for Nuxt module / programmatic usage\nexport type { Options, ImportPluginOptions, StylesOption, StylesConfigFile, ResolvedOptions } from './types'\nexport { importPlugin } from './importPlugin'\nexport { stylesPlugin } from './stylesPlugin'\nexport { generateImports } from './imports/generateImports'\nexport { parseTemplate } from './imports/parseTemplate'\n"],"mappings":";;;;AAmEO,SAAS,eAAgB,KAA+B;AAC7D,QAAM,aACJ,IAAI,eAAe,QACf,QACA,IAAI,eAAe,QAAQ,IAAI,cAAc,OAC7C,CAAC,IACD,I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