| | |
| | | |
| | | const release = await mut.acquire() |
| | | perf.addEvent("clean") |
| | | await rimraf(output) |
| | | await rimraf(path.join(output, "*"), { glob: true }) |
| | | console.log(`Cleaned output directory \`${output}\` in ${perf.timeSince("clean")}`) |
| | | |
| | | perf.addEvent("glob") |
| | |
| | | const emitterGraph = |
| | | (await emitter.getDependencyGraph?.(ctx, processedFiles, staticResources)) ?? null |
| | | |
| | | // emmiter may not define a dependency graph. nothing to update if so |
| | | if (emitterGraph) { |
| | | // only update the graph if the emitter plugin uses the changed file |
| | | // eg. Assets plugin ignores md files, so we skip updating the graph |
| | | if (emitterGraph?.hasNode(fp)) { |
| | | // merge the new dependencies into the dep graph |
| | | dependencies[emitter.name]?.updateIncomingEdgesForNode(emitterGraph, fp) |
| | | } |
| | |
| | | |
| | | // TODO: we can probably traverse the link graph to figure out what's safe to delete here |
| | | // instead of just deleting everything |
| | | await rimraf(argv.output) |
| | | await rimraf(path.join(argv.output, ".*"), { glob: true }) |
| | | await emitContent(ctx, filteredContent) |
| | | console.log(chalk.green(`Done rebuilding in ${perf.timeSince()}`)) |
| | | } catch (err) { |