Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added examples to README, see #258 #331

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading