Skip to content

Commit

Permalink
Merge pull request #83 from easyops-cn/steve/fix-webpack-v5
Browse files Browse the repository at this point in the history
fix(): support webpack v5 since docusaurus v2 alpha 75
  • Loading branch information
weareoutman authored May 8, 2021
2 parents f0de00f + 5d1810b commit ec0d818
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 ec0d818

Please sign in to comment.