Skip to content

Commit

Permalink
Added examples to README, see #258
Browse files Browse the repository at this point in the history
  • Loading branch information
slhck committed Aug 27, 2024
1 parent c69ff0d commit 786fa0b
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,34 @@ Options:
--version Show version number [boolean]
```
Examples:
### Examples
To generate a dts bundle for a single entry file:
```bash
./node_modules/.bin/dts-bundle-generator -o my.d.ts path/to/your/entry-file.ts
```

To generate a dts bundle for multiple entry files:

```bash
./node_modules/.bin/dts-bundle-generator path/to/your/entry-file.ts path/to/your/entry-file-2.ts
```

To generate a dts bundle for a single entry file with external inlines and imports:

```bash
./node_modules/.bin/dts-bundle-generator --external-inlines=@mycompany/internal-project --external-imports=@angular/core rxjs path/to/your/entry-file.ts
./node_modules/.bin/dts-bundle-generator \
--external-inlines=@mycompany/internal-project \
--external-imports=@angular/core rxjs \
-- path/to/your/entry-file.ts
```

> [!NOTE]
> Note that, as in the above example, the arguments accepting arrays (like `--external-inlines` or `--external-imports`) accept multiple values separated by spaces. Since the input file(s) are positional arguments, you need to put the `--` separator before it when it is preceded by an argument that accepts multiple values. Otherwise you will get an error (`Error: No input files specified`).
To generate a dts bundle for a single entry file with external types:

```bash
./node_modules/.bin/dts-bundle-generator --external-types=jquery path/to/your/entry-file.ts
```
Expand Down

0 comments on commit 786fa0b

Please sign in to comment.