From 49bd6bc3ffe1d3507e00bae62c12d9b045363090 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Wed, 09 Aug 2023 05:52:49 +0000
Subject: [PATCH] better concurrency debugging, --concurrency flag for npx quartz build
---
quartz/bootstrap-cli.mjs | 21 ++++++++++-----------
1 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/quartz/bootstrap-cli.mjs b/quartz/bootstrap-cli.mjs
index 68b9f57..adcdb9f 100755
--- a/quartz/bootstrap-cli.mjs
+++ b/quartz/bootstrap-cli.mjs
@@ -12,10 +12,10 @@
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"
+import { randomUUID } from "crypto"
const ORIGIN_NAME = "origin"
const UPSTREAM_NAME = "upstream"
@@ -84,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) {
@@ -297,7 +301,8 @@
outfile: path.join("quartz", cacheFile),
bundle: true,
keepNames: true,
- minify: true,
+ minifyWhitespace: true,
+ minifySyntax: true,
platform: "node",
format: "esm",
jsx: "automatic",
@@ -305,18 +310,11 @@
packages: "external",
metafile: true,
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",
@@ -372,7 +370,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()
}
--
Gitblit v1.10.0