From df02ea20d7e12e8b9ffdd2968afaf5893c433488 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Fri, 11 Aug 2023 04:32:11 +0000
Subject: [PATCH] spacing fix

---
 quartz/build.ts |   29 ++++++-----------------------
 1 files changed, 6 insertions(+), 23 deletions(-)

diff --git a/quartz/build.ts b/quartz/build.ts
index 05edf86..c25efbf 100644
--- a/quartz/build.ts
+++ b/quartz/build.ts
@@ -1,19 +1,5 @@
 import sourceMapSupport from "source-map-support"
-sourceMapSupport.install({
-  retrieveSourceMap(source) {
-    // source map hack to get around query param
-    // import cache busting
-    if (source.includes(".quartz-cache")) {
-      let realSource = fileURLToPath(source.split("?", 2)[0] + ".map")
-      return {
-        map: fs.readFileSync(realSource, "utf8"),
-      }
-    } else {
-      return null
-    }
-  },
-})
-
+sourceMapSupport.install(options)
 import path from "path"
 import { PerfTimer } from "./perf"
 import { rimraf } from "rimraf"
@@ -23,14 +9,13 @@
 import { filterContent } from "./processors/filter"
 import { emitContent } from "./processors/emit"
 import cfg from "../quartz.config"
-import { FilePath, ServerSlug, joinSegments, slugifyFilePath } from "./path"
+import { FilePath, joinSegments, slugifyFilePath } from "./path"
 import chokidar from "chokidar"
 import { ProcessedContent } from "./plugins/vfile"
 import { Argv, BuildCtx } from "./ctx"
 import { glob, toPosixPath } from "./glob"
 import { trace } from "./trace"
-import { fileURLToPath } from "url"
-import fs from "fs"
+import { options } from "./sourcemap"
 
 async function buildQuartz(argv: Argv, clientRefresh: () => void) {
   const ctx: BuildCtx = {
@@ -115,7 +100,6 @@
       return
     }
 
-
     if (action === "add" || action === "change") {
       toRebuild.add(filePath)
     } else if (action === "delete") {
@@ -133,10 +117,9 @@
       try {
         const filesToRebuild = [...toRebuild].filter((fp) => !toRemove.has(fp))
 
-        const trackedSlugs =
-          [...new Set([...contentMap.keys(), ...toRebuild, ...trackedAssets])]
-            .filter((fp) => !toRemove.has(fp))
-            .map((fp) => slugifyFilePath(path.posix.relative(argv.directory, fp) as FilePath))
+        const trackedSlugs = [...new Set([...contentMap.keys(), ...toRebuild, ...trackedAssets])]
+          .filter((fp) => !toRemove.has(fp))
+          .map((fp) => slugifyFilePath(path.posix.relative(argv.directory, fp) as FilePath))
 
         ctx.allSlugs = [...new Set([...initialSlugs, ...trackedSlugs])]
         const parsedContent = await parseMarkdown(ctx, filesToRebuild)

--
Gitblit v1.10.0