Jacky Zhao
2025-04-28 32d3fc0ce8945c7d9aace2235a0f6f9663895b58
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import fs from "fs"
import sourceMapSupport from "source-map-support"
import { fileURLToPath } from "url"
 
export const options: sourceMapSupport.Options = {
  // source map hack to get around query param
  // import cache busting
  retrieveSourceMap(source) {
    if (source.includes(".quartz-cache")) {
      let realSource = fileURLToPath(source.split("?", 2)[0] + ".map")
      return {
        map: fs.readFileSync(realSource, "utf8"),
      }
    } else {
      return null
    }
  },
}