Skip to content

Commit 099bb97

Browse files
committed
feat(module): autoImport FormKit Vue components
1 parent c9a386e commit 099bb97

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/module.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,30 +61,32 @@ export default defineNuxtModule<ModuleOptions>({
6161
}
6262
_nuxt.options.css = css
6363

64-
const names = [
65-
'useFormKitSchema',
66-
'useFormKitRepeater',
67-
'useInputEditor',
68-
'useInputEditorSchema',
69-
]
70-
7164
const NPM_PCK_FORMKIT_PRIMEVUE = '@sfxcode/formkit-primevue'
7265

73-
names.forEach(name =>
66+
const composableNames = ['useFormKitSchema', 'useFormKitRepeater', 'useInputEditor', 'useInputEditorSchema']
67+
composableNames.forEach(name =>
7468
addImports({ name, as: name, from: NPM_PCK_FORMKIT_PRIMEVUE }),
7569
)
7670

77-
const componentNames = [
78-
'FormKitDataEdit',
79-
'FormKitDataView',
80-
'FormKitDataDebug',
81-
]
82-
71+
const componentNames = ['FormKitDataEdit', 'FormKitDataView', 'FormKitDataDebug']
8372
componentNames.forEach(name =>
8473
addComponent({
8574
name,
8675
export: name,
8776
filePath: NPM_PCK_FORMKIT_PRIMEVUE,
77+
chunkName: NPM_PCK_FORMKIT_PRIMEVUE,
78+
}),
79+
)
80+
81+
const NPM_PCK_FORMKIT = '@formkit/vue'
82+
83+
const formKitComponentNames = ['FormKit', 'FormKitProvider', 'FormKitMessages', 'FormKitSummary', 'FormKitSchema']
84+
formKitComponentNames.forEach(name =>
85+
addComponent({
86+
name,
87+
export: name,
88+
filePath: NPM_PCK_FORMKIT,
89+
chunkName: NPM_PCK_FORMKIT,
8890
}),
8991
)
9092

0 commit comments

Comments
 (0)