Skip to content

Commit

Permalink
fix: vueuse preset
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Aug 24, 2021
1 parent 7b70f28 commit 5692933
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/presets/vueuse-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ export default (): ImportsMap => {
try {
/* eslint-disable @typescript-eslint/no-var-requires */
const indexesJson = require('@vueuse/core/indexes.json')
_cache = indexesJson
.functions
.filter((i: any) => ['core', 'shared'].includes(i.package))
.map((i: any) => i.name as string)
// only include functions with 4 characters or more
.filter((i: string) => i && i.length >= 4)
_cache = {
'@vueuse/core': indexesJson
.functions
.filter((i: any) => ['core', 'shared'].includes(i.package))
.map((i: any) => i.name as string)
// only include functions with 4 characters or more
.filter((i: string) => i && i.length >= 4),
}
}
catch (error) {
throw new Error('[auto-import] failed to load @vueuse/core, have you installed it?')
Expand Down

0 comments on commit 5692933

Please sign in to comment.