Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix: handle useFetch properly
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Sep 17, 2022
1 parent 0bf93f0 commit b304b67
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/vite/src/plugins/composable-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const composableKeysPlugin = createUnplugin((options: ComposableKeysOptio

case 'useFetch':
case 'useLazyFetch':
if (node.arguments.length >= 2) { return }
if (node.arguments.length >= 3 || stringTypes.includes(node.arguments[1]?.type)) { return }
break

case 'useAsyncData':
Expand All @@ -59,9 +59,8 @@ export const composableKeysPlugin = createUnplugin((options: ComposableKeysOptio
break
}

const end = (node as any).end
s.appendLeft(
codeIndex + end - 1,
codeIndex + (node as any).end - 1,
(node.arguments.length ? ', ' : '') + "'$" + hash(`${relativeID}-${++count}`) + "'"
)
}
Expand Down

0 comments on commit b304b67

Please sign in to comment.