Jacky Zhao
2023-08-06 a0d651d64dfd766157324fd86791da2168028cf2
quartz/bootstrap-cli.mjs
@@ -16,6 +16,7 @@
import http from "http"
import serveHandler from "serve-handler"
import { WebSocketServer } from "ws"
import { randomUUID } from "crypto"
const ORIGIN_NAME = "origin"
const UPSTREAM_NAME = "upstream"
@@ -297,7 +298,8 @@
      outfile: path.join("quartz", cacheFile),
      bundle: true,
      keepNames: true,
      minify: true,
      minifyWhitespace: true,
      minifySyntax: true,
      platform: "node",
      format: "esm",
      jsx: "automatic",
@@ -305,6 +307,7 @@
      packages: "external",
      metafile: true,
      sourcemap: true,
      sourcesContent: false,
      plugins: [
        sassPlugin({
          type: "css-text",
@@ -372,7 +375,8 @@
      }
      // bypass module cache
      const { default: buildQuartz } = await import(cacheFile + `?update=${new Date()}`)
      // https://github.com/nodejs/modules/issues/307
      const { default: buildQuartz } = await import(cacheFile + `?update=${randomUUID()}`)
      await buildQuartz(argv, clientRefresh)
      clientRefresh()
    }