Jacky Zhao
2025-04-18 b34d521293415944370fd0f5cf25cd71bcffb5b6
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
    }
  },
}