# @jakehamilton/dts-webpack-plugin

> A webpack plugin to generate type definitions.

Latest version **1.4.5** (published 2022-04-14) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @jakehamilton/dts-webpack-plugin
pnpm add @jakehamilton/dts-webpack-plugin
yarn add @jakehamilton/dts-webpack-plugin
bun add @jakehamilton/dts-webpack-plugin
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.5 |
| Published | 2022-04-14 |
| First published | 2020-09-08 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 27.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jake Hamilton |
| Maintainers | jakehamilton |
| Keywords | webpack, typescript, dts |

## Links

- npm: https://www.npmjs.com/package/@jakehamilton/dts-webpack-plugin
- Repository: https://github.com/jakehamilton/packages
- Issues: https://github.com/jakehamilton/packages/issues
- npm.io page: https://npm.io/package/@jakehamilton/dts-webpack-plugin

## Dependencies (6)

- [tmp](https://npm.io/package/tmp.md) ^0.2.1
- [mkdirp](https://npm.io/package/mkdirp.md) ^1.0.4
- [rimraf](https://npm.io/package/rimraf.md) ^3.0.2
- [npm-run](https://npm.io/package/npm-run.md) ^5.0.1
- [schema-utils](https://npm.io/package/schema-utils.md) ^2.7.1
- [@littlethings/log](https://npm.io/package/@littlethings/log.md) ^1.3.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.4.5 (latest) — 2022-04-14
- 1.4.4 — 2022-02-04
- 1.4.3 — 2021-05-03
- 1.4.2 — 2021-01-10
- 1.4.1 — 2021-01-01
- 1.4.0 — 2020-09-26
- 1.3.0 — 2020-09-26
- 1.2.0 — 2020-09-22
- 1.1.16 — 2020-09-19
- 1.1.15 — 2020-09-10
- 1.1.13 — 2020-09-10
- 1.1.12 — 2020-09-10
- 1.1.11 — 2020-09-10
- 1.1.10 — 2020-09-10
- 1.1.9 — 2020-09-10
- … 8 more at https://npm.io/package/@jakehamilton/dts-webpack-plugin/versions

## README

# `@jakehamilton/dts-webpack-plugin`

> Generate type definitions after your webpack build.

## Installation

```shell
npm install --save-dev @jakehamilton/dts-webpack-plugin
```

## Usage

```js
const DTSWebpackPlugin = require("@jakehamilton/dts-webpack-plugin");

module.exports = {
    plugins: [
        new DTSWebpackPlugin({
            // Optional root directory to search for package.json,
            // tsconfig.json, and code in.
            root: "/my/project/",

            // Optional arguments for the typescript compiler.
            tsc: "--strict",

            // Optional path to a tsconfig.json file.
            tsconfig: "/my/project/tsconfig.json",

            // Optional function to determine whether a module should be
            // included or not.
            match: (name) => !name.endsWith(".stories.ts"),

            // Optional map of transformations.
            transforms: {
                module: (origin, identifier, line, files, aliases) => {
                    // `origin` is the module that an import/export takes place.
                    // `identifier` is the name/path of the import/export.
                    // `line` is the whole line where the import/export occurs.
                    // `files` is an object containing all type definition files and their contents.
                    // `aliases` is an object of aliases from your tsconfig.json file.

                    // Example removing css imports
                    // WARNING: this only works if the import was written on one line.
                    if (identifier.endsWith(".css")) {
                        return "";
                    }
                },
            },
        }),
    ],
};
```

---
_Source: https://npm.io/package/@jakehamilton/dts-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
