# dts-webpack-bundler

> Bundler for your ts / tsx files that actually works

Latest version **1.0.3** (published 2017-11-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install dts-webpack-bundler
pnpm add dts-webpack-bundler
yarn add dts-webpack-bundler
bun add dts-webpack-bundler
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2017-11-02 |
| First published | 2017-10-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Eliraz Kedmi |
| Maintainers | eliraz-refael |
| Keywords | dts, defenition-files, typscript, webpack, bundler |

## Links

- npm: https://www.npmjs.com/package/dts-webpack-bundler
- Repository: https://github.com/eliraz-refael/dts-webpack-bundler
- Homepage: https://github.com/eliraz-refael/dts-webpack-bundler#readme
- Issues: https://github.com/eliraz-refael/dts-webpack-bundler/issues
- npm.io page: https://npm.io/package/dts-webpack-bundler

## Dependencies (2)

- [rimraf](https://npm.io/package/rimraf.md) ^2.6.2
- [dts-bundle](https://npm.io/package/dts-bundle.md) ^0.7.3

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2017-11-02
- 1.0.2 — 2017-10-19
- 1.0.1 — 2017-10-19
- 1.0.0 — 2017-10-19

## README

# dts-webpack-bundler

This Webpack plugin generate a single TypeScript *.d.ts declaration file per entry (per chunk) using [dts-bundle](https://github.com/TypeStrong/dts-bundle).

*Currently supporting only webpack v3.x*

### Installation

```shell
$ npm install dts-webpack-bundler --save-dev
```

### Usage

##### First you need to add the following to tsconfig.json:
#### NOTE: currently this plugin support only declaration files that are gathered into a single folder so, please make sure you're using `"declarationDir"` properly.

```javascript
{
    "compilerOptions": {
        // ...
        "declaration": true,
        "declarationDir": "./typings/"
    }
}
```

##### Then in your webpack.config.js:

```javascript
const DtsWebpackBundler = require('dts-webpack-bundler');

module.exports = {
    entry: './src/main.ts',
    output: {
        path: path.resolve('./dist'),
        filename: 'index.js'
    },
    plugins: [
        new DtsWebpackBundler({
			libName: 'library-name',
			typingsDir: path.resolve(process.cwd(), 'typings'),
			outputDir: path.resolve(process.cwd(), 'build'),
			deleteSource: true // deletes the typings folder after bundling it.
        })
    ]
}
```

### Have Fun!

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