mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-29 00:47:03 +02:00
perf/fix(v2): more efficient hot reload & consistent filegen (#1950)
* perf(v2): efficient hot reload, consistent generated file * changelog * more
This commit is contained in:
parent
87f864e5ba
commit
e04c8f140f
7 changed files with 60 additions and 6 deletions
packages/docusaurus-utils/src
|
@ -31,6 +31,15 @@ export async function generate(
|
|||
}
|
||||
}
|
||||
|
||||
export function objectWithKeySorted(obj: Object) {
|
||||
// https://github.com/lodash/lodash/issues/1459#issuecomment-253969771
|
||||
return _(obj)
|
||||
.toPairs()
|
||||
.sortBy(0)
|
||||
.fromPairs()
|
||||
.value();
|
||||
}
|
||||
|
||||
const indexRE = /(^|.*\/)index\.(md|js)$/i;
|
||||
const extRE = /\.(md|js)$/;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue