Skip to content

feat: add --no-minify arg to build script #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions bin/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ export default async function run(args?: string[]): Promise<void> {
type: "string",
default: "./"
},
minify: {
type: "boolean",
// Default to true; use --no-minify to disable
default: true
},
template: {
type: "string"
},
Expand All @@ -45,6 +50,7 @@ export default async function run(args?: string[]): Promise<void> {
--template <path> path to the HTML template
-o, --out <dir> path to the output directory (relative to root)
--base <path> 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
`);
Expand All @@ -57,6 +63,8 @@ export default async function run(args?: string[]): Promise<void> {
root: values.root,
base: values.base,
build: {
minify: values.minify ? "esbuild" : false,
cssMinify: values.minify ? "esbuild" : false,
outDir: values.out,
emptyOutDir: values.empty,
rollupOptions: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down