From ebf3263b7efacc9ac499f3f1f1bbc91451899ae0 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Wed, 09 Aug 2023 16:10:40 +0000
Subject: [PATCH] update npx quartz update script

---
 quartz/bootstrap-cli.mjs |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/quartz/bootstrap-cli.mjs b/quartz/bootstrap-cli.mjs
index d550aea..d00a242 100755
--- a/quartz/bootstrap-cli.mjs
+++ b/quartz/bootstrap-cli.mjs
@@ -12,7 +12,6 @@
 import chokidar from "chokidar"
 import prettyBytes from "pretty-bytes"
 import { execSync, spawnSync } from "child_process"
-import { transform as cssTransform } from "lightningcss"
 import http from "http"
 import serveHandler from "serve-handler"
 import { WebSocketServer } from "ws"
@@ -85,6 +84,10 @@
     default: false,
     describe: "show detailed bundle information",
   },
+  concurrency: {
+    number: true,
+    describe: "how many threads to use to parse notes",
+  },
 }
 
 function escapePath(fp) {
@@ -126,7 +129,7 @@
 }
 
 function gitPull(origin, branch) {
-  const flags = ["-s", "recursive", "-X", "ours", "--no-edit"]
+  const flags = ["--no-rebase", "--autostash", "-s", "recursive", "-X", "ours", "--no-edit"]
   spawnSync("git", ["pull", ...flags, origin, branch], { stdio: "inherit" })
 }
 
@@ -298,27 +301,20 @@
       outfile: path.join("quartz", cacheFile),
       bundle: true,
       keepNames: true,
-      minify: true,
+      minifyWhitespace: true,
+      minifySyntax: true,
       platform: "node",
       format: "esm",
       jsx: "automatic",
       jsxImportSource: "preact",
       packages: "external",
       metafile: true,
-      sourcemap: "inline",
+      sourcemap: true,
       sourcesContent: false,
       plugins: [
         sassPlugin({
           type: "css-text",
           cssImports: true,
-          async transform(css) {
-            const { code } = cssTransform({
-              filename: "style.css",
-              code: Buffer.from(css),
-              minify: true,
-            })
-            return code.toString()
-          },
         }),
         {
           name: "inline-script-loader",
@@ -374,6 +370,7 @@
       }
 
       // bypass module cache
+      // https://github.com/nodejs/modules/issues/307
       const { default: buildQuartz } = await import(cacheFile + `?update=${randomUUID()}`)
       await buildQuartz(argv, clientRefresh)
       clientRefresh()

--
Gitblit v1.10.0