mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-01 06:28:14 +00:00
fix watch-mode batching
This commit is contained in:
parent
569ff1a801
commit
041a4ce7bc
14 changed files with 91 additions and 77 deletions
quartz/plugins
|
@ -1,15 +1,15 @@
|
|||
import { StaticResources } from "../resources"
|
||||
import { PluginTypes } from "./types"
|
||||
import { FilePath, ServerSlug } from "../path"
|
||||
import { BuildCtx } from "../ctx"
|
||||
|
||||
export function getStaticResourcesFromPlugins(plugins: PluginTypes) {
|
||||
export function getStaticResourcesFromPlugins(ctx: BuildCtx) {
|
||||
const staticResources: StaticResources = {
|
||||
css: [],
|
||||
js: [],
|
||||
}
|
||||
|
||||
for (const transformer of plugins.transformers) {
|
||||
const res = transformer.externalResources ? transformer.externalResources() : {}
|
||||
for (const transformer of ctx.cfg.plugins.transformers) {
|
||||
const res = transformer.externalResources ? transformer.externalResources(ctx) : {}
|
||||
if (res?.js) {
|
||||
staticResources.js.push(...res.js)
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ declare module "vfile" {
|
|||
// inserted in processors.ts
|
||||
interface DataMap {
|
||||
slug: ServerSlug
|
||||
allSlugs: ServerSlug[]
|
||||
filePath: FilePath
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue