Skip to content

Commit

Permalink
fix: webpack aliases sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
jrvidal committed Mar 8, 2022
1 parent 61290c4 commit 8ae30b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/docusaurus/src/server/themes/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function sortAliases(aliases: ThemeAliases): ThemeAliases {
const entries = _.sortBy(Object.entries(aliases), ([alias]) => alias);
// @theme/NavbarItem should be after @theme/NavbarItem/LocaleDropdown
entries.sort(([alias1], [alias2]) =>
alias1.includes(`${alias2}/`) ? -1 : 0,
alias1.includes(`${alias2}/`) ? -1 : alias2.includes(`${alias1}/`) ? 1 : 0,
);
return Object.fromEntries(entries);
}
Expand Down

0 comments on commit 8ae30b0

Please sign in to comment.