Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(): support webpack v5 since docusaurus v2 alpha 75 #83

Merged
merged 1 commit into from
May 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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