From 581989f8f399c41b6b8a4554cce9ca2e0a10dd58 Mon Sep 17 00:00:00 2001 From: Ryan Christian <33403762+rschristian@users.noreply.github.com> Date: Thu, 24 Mar 2022 14:51:39 -0500 Subject: [PATCH 1/3] docs: Add info on --compress default value --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 26e074d8..bb68aead 100644 --- a/README.md +++ b/README.md @@ -328,19 +328,19 @@ Options --globals Specify globals dependencies, or 'none' --define Replace constants with hard-coded values (use @key=exp to replace an expression) --alias Map imports to different modules - --compress Compress output using Terser + --compress Compress output using Terser (default true when --target is web, false when --target is node) --strict Enforce undefined global context and add "use strict" --name Specify name exposed in UMD and IIFE builds --cwd Use an alternative working directory (default .) --sourcemap Generate source map (default true) --raw Show raw byte size (default false) - --jsx A custom JSX pragma like React.createElement (default: h) - --jsxFragment A custom JSX fragment pragma like React.Fragment (default: Fragment) + --jsx A custom JSX pragma like React.createElement (default h) + --jsxFragment A custom JSX fragment pragma like React.Fragment (default Fragment) --jsxImportSource Declares the module specifier to be used for importing jsx factory functions --tsconfig Specify the path to a custom tsconfig.json --generateTypes Whether or not to generate types, if `types` or `typings` is set in `package.json` then it will default to be `true` - --css Where to output CSS: "inline" or "external" (default: "external") - --css-modules Configures .css to be treated as modules (default: null) + --css Where to output CSS: "inline" or "external" (default "external") + --css-modules Configures .css to be treated as modules (default null) --workers Bundle module workers - see https://git.io/J3oSF (default false) -h, --help Displays this message From 55b4767f3e71af5297d70a9624ea00f91daad93c Mon Sep 17 00:00:00 2001 From: Ryan Christian <33403762+rschristian@users.noreply.github.com> Date: Thu, 24 Mar 2022 15:02:32 -0500 Subject: [PATCH 2/3] docs: Update CLI help menu --compress info --- src/prog.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/prog.js b/src/prog.js index 6049501c..bbaf7444 100644 --- a/src/prog.js +++ b/src/prog.js @@ -13,7 +13,7 @@ export default handler => { opts.entries = toArray(str || opts.entry).concat(opts._); - if (opts.compress != null) { + if (typeof opts.compress !== 'undefined') { // Convert `--compress true/false/1/0` to booleans: if (typeof opts.compress !== 'boolean') { opts.compress = opts.compress !== 'false' && opts.compress !== '0'; @@ -51,7 +51,11 @@ export default handler => { .example('--define API_KEY=1234') .option('--alias', `Map imports to different modules`) .example('--alias react=preact') - .option('--compress', 'Compress output using Terser', null) + .option( + '--compress', + 'Compress output using Terser (default true when --target is web, false when --target is node)', + ) + .example('build --target web --no-compress') .option('--strict', 'Enforce undefined global context and add "use strict"') .option('--name', 'Specify name exposed in UMD builds') .option('--cwd', 'Use an alternative working directory', '.') From 5bb57f2e7ef6fe842e2db323572d3df6db254d1d Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Thu, 24 Mar 2022 15:10:07 -0500 Subject: [PATCH 3/3] docs: Adding changeset --- .changeset/big-cameras-attend.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/big-cameras-attend.md diff --git a/.changeset/big-cameras-attend.md b/.changeset/big-cameras-attend.md new file mode 100644 index 00000000..ddfcd845 --- /dev/null +++ b/.changeset/big-cameras-attend.md @@ -0,0 +1,5 @@ +--- +'microbundle': patch +--- + +Adds information about `--compress` flag's default value w/ different targets