Skip to content

Commit

Permalink
fix(): support webpack v5 since docusaurus v2 alpha 75
Browse files Browse the repository at this point in the history
fixes #81
  • Loading branch information
weareoutman committed May 8, 2021
1 parent f0de00f commit 5d1810b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/client/theme/SearchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,16 @@ import LoadingRing from "../LoadingRing/LoadingRing";
import styles from "./SearchBar.module.css";

async function fetchAutoCompleteJS(): Promise<any> {
const autoComplete = await import("@easyops-cn/autocomplete.js");
autoComplete.noConflict();
return autoComplete.default;
const autoCompleteModule = await import("@easyops-cn/autocomplete.js");
const autoComplete = autoCompleteModule.default;
if (autoComplete.noConflict) {
// For webpack v5 since docusaurus v2.0.0-alpha.75
autoComplete.noConflict();
} else if (autoCompleteModule.noConflict) {
// For webpack v4 before docusaurus v2.0.0-alpha.74
autoCompleteModule.noConflict();
}
return autoComplete;
}

const SEARCH_PARAM_HIGHLIGHT = "_highlight";
Expand Down

0 comments on commit 5d1810b

Please sign in to comment.