Skip to content

Commit

Permalink
fix: Allow multiple formats to be passed.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Jan 6, 2023
1 parent 471ea59 commit 5ade653
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/packemon/src/Package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ export class Package {

toArray(config.platform).forEach((platform) => {
let { api, bundle } = config;
let formats = config.format ? [config.format] : [];
let formats = toArray(config.format);

switch (platform) {
case 'native':
Expand Down
2 changes: 1 addition & 1 deletion packages/packemon/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export interface PackemonPackageConfig {
api?: ApiType;
bundle?: boolean;
externals?: string[] | string;
format?: Format;
format?: Format | Format[];
inputs?: InputMap;
namespace?: string;
platform?: Platform | Platform[];
Expand Down
8 changes: 8 additions & 0 deletions website/docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ project root that will house the built files.
}
```

To support multiple formats, pass an array.

```json
{
"format": ["lib", "esm"]
}
```

## Inputs

A mapping of entry points for the library (only when [bundling](#bundle)), where the object key is
Expand Down

0 comments on commit 5ade653

Please sign in to comment.