From ecc4c036f139895209ffd287442780b80e64ac52 Mon Sep 17 00:00:00 2001 From: Gordon Smith Date: Sat, 9 Aug 2025 17:23:33 +0100 Subject: [PATCH 1/3] feat: add --no-minify arg to build script Signed-off-by: Gordon Smith --- bin/build.ts | 8 ++++++++ package.json | 1 + 2 files changed, 9 insertions(+) diff --git a/bin/build.ts b/bin/build.ts index 0b5fb4e..3d6896f 100755 --- a/bin/build.ts +++ b/bin/build.ts @@ -25,6 +25,11 @@ export default async function run(args?: string[]): Promise { type: "string", default: "./" }, + minify: { + type: "boolean", + // Default to true; use --no-minify to disable + default: true + }, template: { type: "string" }, @@ -45,6 +50,7 @@ export default async function run(args?: string[]): Promise { --template path to the HTML template -o, --out path to the output directory (relative to root) --base serving base path; defaults to ./ + --no-minify disable JS/CSS minification --empty whether to empty the output directory before building -h, --help show this message `); @@ -57,6 +63,8 @@ export default async function run(args?: string[]): Promise { root: values.root, base: values.base, build: { + minify: values.minify ? "esbuild" : false, + cssMinify: values.minify ? "esbuild" : false, outDir: values.out, emptyOutDir: values.empty, rollupOptions: { diff --git a/package.json b/package.json index fde535c..69e70a9 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "notebooks": "tsx bin/notebooks.ts", "download": "tsx bin/notebooks.ts download", "docs:preview": "tsx --watch bin/notebooks.ts preview --root docs --template docs/observable.tmpl", + "docs:build-dev": "tsx bin/notebooks.ts build --root docs --template docs/observable.tmpl --no-minify -- $(find docs -path 'docs/.observable' -prune -o -name '*.html' -print)", "docs:build": "tsx bin/notebooks.ts build --root docs --template docs/observable.tmpl -- $(find docs -path 'docs/.observable' -prune -o -name '*.html' -print)" }, "bin": { From a563fb8946d79a64aee0c952763d438aeb2d5c6d Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Mon, 11 Aug 2025 10:39:29 -0400 Subject: [PATCH 2/3] remove docs:build-dev command --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 69e70a9..fde535c 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "notebooks": "tsx bin/notebooks.ts", "download": "tsx bin/notebooks.ts download", "docs:preview": "tsx --watch bin/notebooks.ts preview --root docs --template docs/observable.tmpl", - "docs:build-dev": "tsx bin/notebooks.ts build --root docs --template docs/observable.tmpl --no-minify -- $(find docs -path 'docs/.observable' -prune -o -name '*.html' -print)", "docs:build": "tsx bin/notebooks.ts build --root docs --template docs/observable.tmpl -- $(find docs -path 'docs/.observable' -prune -o -name '*.html' -print)" }, "bin": { From ad454fc12c942e60254e08a9a215da1dc198a7b3 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Mon, 11 Aug 2025 10:39:43 -0400 Subject: [PATCH 3/3] remove comment --- bin/build.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/build.ts b/bin/build.ts index 3d6896f..d6d40aa 100755 --- a/bin/build.ts +++ b/bin/build.ts @@ -27,7 +27,6 @@ export default async function run(args?: string[]): Promise { }, minify: { type: "boolean", - // Default to true; use --no-minify to disable default: true }, template: {