fix(cli): filter files on rebuild using --serve (#2039)
* filter files on rebuild * fix prettier
This commit is contained in:
parent
52a5196f38
commit
930eb1c413
1 changed files with 6 additions and 3 deletions
|
@ -251,9 +251,12 @@ async function rebuild(changes: ChangeEvent[], clientRefresh: () => void, buildD
|
||||||
// update allFiles and then allSlugs with the consistent view of content map
|
// update allFiles and then allSlugs with the consistent view of content map
|
||||||
ctx.allFiles = Array.from(contentMap.keys())
|
ctx.allFiles = Array.from(contentMap.keys())
|
||||||
ctx.allSlugs = ctx.allFiles.map((fp) => slugifyFilePath(fp as FilePath))
|
ctx.allSlugs = ctx.allFiles.map((fp) => slugifyFilePath(fp as FilePath))
|
||||||
const processedFiles = Array.from(contentMap.values())
|
let processedFiles = filterContent(
|
||||||
.filter((file) => file.type === "markdown")
|
ctx,
|
||||||
.map((file) => file.content)
|
Array.from(contentMap.values())
|
||||||
|
.filter((file) => file.type === "markdown")
|
||||||
|
.map((file) => file.content),
|
||||||
|
)
|
||||||
|
|
||||||
let emittedFiles = 0
|
let emittedFiles = 0
|
||||||
for (const emitter of cfg.plugins.emitters) {
|
for (const emitter of cfg.plugins.emitters) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue