Skip to content

Commit 017c860

Browse files
committed
build: fix mutli format build script
1 parent c2ff3bd commit 017c860

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

rollup.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const outputConfigs = {
9898
const defaultFormats = ['esm-bundler', 'cjs']
9999
/** @type {ReadonlyArray<PackageFormat>} */
100100
const inlineFormats = /** @type {any} */ (
101-
process.env.FORMATS && process.env.FORMATS.split(',')
101+
process.env.FORMATS && process.env.FORMATS.split('+')
102102
)
103103
/** @type {ReadonlyArray<PackageFormat>} */
104104
const packageFormats = inlineFormats || packageOptions.formats || defaultFormats

scripts/build.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ Produces production builds and stitches together d.ts files.
55
66
To specify the package to build, simply pass its name and the desired build
77
formats to output (defaults to `buildOptions.formats` specified in that package,
8-
or "esm,cjs"):
8+
or ["esm-bundler", "cjs"]):
99
1010
```
1111
# name supports fuzzy match. will build all packages with name containing "dom":
1212
nr build dom
1313
1414
# specify the format to output
15-
nr build core --formats cjs
15+
nr build vue -f cjs
16+
17+
# to specify multiple formats, separate with "+":
18+
nr build vue -f esm-bundler+esm-browser
1619
```
1720
*/
1821

0 commit comments

Comments
 (0)