Skip to content

Commit

Permalink
Merge pull request #186 from Lehoczky/main
Browse files Browse the repository at this point in the history
fix(docsearch): do not import directly from `docsearch`
  • Loading branch information
Baroshem authored Oct 30, 2023
2 parents 8557c41 + 1dacee6 commit 5fe08b4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/runtime/components/AlgoliaDocSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
<script setup lang="ts">
import type { PropType } from 'vue'
import { withoutTrailingSlash } from 'ufo'
import { DocSearchProps, type docsearch as docsearchFunc } from 'docsearch'
import type { DocSearchTranslations } from '@docsearch/react'
import type { DocSearchTranslations, DocSearchProps } from '@docsearch/react'
import type { HitComponentFunc, ModuleBaseOptions, SearchOptions } from '../../types'
// @ts-ignore - These are Nuxt3 aliases
import { useRuntimeConfig, useRoute, useRouter, onMounted, watch } from '#imports'
Expand Down Expand Up @@ -144,7 +143,9 @@ const withoutBaseUrl = (url: string) => {
return url
}
const importDocSearchAtRuntime = async (): Promise<typeof docsearchFunc> => {
type DocSearchFunc = (props: DocSearchProps & {container: HTMLElement | string}) => void
const importDocSearchAtRuntime = async (): Promise<DocSearchFunc> => {
const [docsearch] = await Promise.all([
// @ts-ignore
import(/* webpackChunkName: "docsearch" */ '@docsearch/js'),
Expand Down

0 comments on commit 5fe08b4

Please sign in to comment.