Skip to content

Commit dd0bdde

Browse files
authored
fix: Ensuring CLI & docs match up with each other (#904)
1 parent afa74ca commit dd0bdde

File tree

3 files changed

+25
-20
lines changed

3 files changed

+25
-20
lines changed

.changeset/tame-horses-type.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'microbundle': patch
3+
---
4+
5+
Added missing CLI doc for 'jsxImportSource' and correcting the Examples section of the '--help' output

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,14 +329,13 @@ Options
329329
--define Replace constants with hard-coded values (use @key=exp to replace an expression)
330330
--alias Map imports to different modules
331331
--compress Compress output using Terser
332-
--no-compress Disable output compressing
333332
--strict Enforce undefined global context and add "use strict"
334333
--name Specify name exposed in UMD and IIFE builds
335334
--cwd Use an alternative working directory (default .)
336335
--sourcemap Generate source map (default true)
337336
--raw Show raw byte size (default false)
338337
--jsx A custom JSX pragma like React.createElement (default: h)
339-
--jsxImportSource Specify the automatic import source for JSX like preact
338+
--jsxImportSource Declares the module specifier to be used for importing jsx factory functions
340339
--tsconfig Specify the path to a custom tsconfig.json
341340
--generateTypes Whether or not to generate types, if `types` or `typings` is set in `package.json` then it will default to be `true`
342341
--css Where to output CSS: "inline" or "external" (default: "external")

src/prog.js

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,39 +46,40 @@ export default handler => {
4646
.option('--target', 'Specify your target environment (node or web)', 'web')
4747
.option('--external', `Specify external dependencies, or 'none'`)
4848
.option('--globals', `Specify globals dependencies, or 'none'`)
49-
.example('microbundle --globals react=React,jquery=$')
49+
.example('--globals react=React,jquery=$')
5050
.option('--define', 'Replace constants with hard-coded values')
51-
.example('microbundle --define API_KEY=1234')
51+
.example('--define API_KEY=1234')
5252
.option('--alias', `Map imports to different modules`)
53-
.example('microbundle --alias react=preact')
53+
.example('--alias react=preact')
5454
.option('--compress', 'Compress output using Terser', null)
5555
.option('--strict', 'Enforce undefined global context and add "use strict"')
5656
.option('--name', 'Specify name exposed in UMD builds')
5757
.option('--cwd', 'Use an alternative working directory', '.')
5858
.option('--sourcemap', 'Generate source map')
59-
.option('--css', 'Where to output CSS: "inline" or "external"', 'external')
60-
.option(
61-
'--workers',
62-
'Bundle module workers - see https://git.io/J3oSF',
63-
false,
64-
)
65-
.option(
66-
'--css-modules',
67-
'Turns on css-modules for all .css imports. Passing a string will override the scopeName. eg --css-modules="_[hash]"',
68-
null,
69-
)
70-
.example("microbundle --no-sourcemap # don't generate sourcemaps")
59+
.example("watch --no-sourcemap # don't generate sourcemaps")
7160
.option('--raw', 'Show raw byte size', false)
61+
.option('--jsx', 'A custom JSX pragma like React.createElement', 'h')
7262
.option(
73-
'--jsx',
74-
'A custom JSX pragma like React.createElement (default: h)',
63+
'--jsxImportSource',
64+
'Declares the module specifier to be used for importing jsx factory functions',
7565
)
7666
.option('--tsconfig', 'Specify the path to a custom tsconfig.json')
67+
.example('build --tsconfig tsconfig.build.json')
7768
.option(
7869
'--generateTypes',
7970
'Whether or not to generate types , if `types` or `typings` is set in `package.json` then it will default to be `true`',
8071
)
81-
.example('microbundle build --tsconfig tsconfig.build.json');
72+
.option('--css', 'Where to output CSS: "inline" or "external"', 'external')
73+
.option(
74+
'--css-modules',
75+
'Turns on css-modules for all .css imports. Passing a string will override the scopeName. eg --css-modules="_[hash]"',
76+
null,
77+
)
78+
.option(
79+
'--workers',
80+
'Bundle module workers - see https://git.io/J3oSF',
81+
false,
82+
);
8283

8384
prog
8485
.command('build [...entries]', '', { default: true })

0 commit comments

Comments
 (0)