Skip to content

Commit 5f70b57

Browse files
committed
feat: resolve subpath exports in import map
1 parent eed92c4 commit 5f70b57

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/shared/src/imports/getImports.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ export function getImports (source: string, options: Options) {
3939
}
4040

4141
resolvedComponents.forEach(component => {
42-
addImport(imports, component.name, component.symbol, 'vuetify/lib/' + (map.components as any)[component.name].from)
42+
const from = (map.components as any)[component.name].from
43+
// Vuetify 3.7.11+ resolves to subpath exports instead of a file in /lib
44+
const lib = from.endsWith('.mjs') ? 'lib/' : ''
45+
addImport(imports, component.name, component.symbol, 'vuetify/' + lib + from)
4346
})
4447
resolvedDirectives.forEach(directive => {
45-
addImport(imports, directive.name, directive.symbol, 'vuetify/lib/directives/index.mjs')
48+
addImport(imports, directive.name, directive.symbol, 'vuetify/directives')
4649
})
4750

4851
return {

0 commit comments

Comments
 (0)