# tsc-webpack-plugin

> A TypeScript plugin for webpack.

Latest version **0.0.4** (published 2020-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install tsc-webpack-plugin
pnpm add tsc-webpack-plugin
yarn add tsc-webpack-plugin
bun add tsc-webpack-plugin
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2020-10-27 |
| First published | 2020-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.13.0 |
| Dependencies | 1 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Damian Pieczynski piecyk@gmail.com |
| Maintainers | piecyk |
| Keywords | webpack, plugin, typescript |

## Links

- npm: https://www.npmjs.com/package/tsc-webpack-plugin
- Repository: https://github.com/piecyk/tsc-webpack-plugin
- Homepage: https://github.com/piecyk/tsc-webpack-plugin#readme
- Issues: https://github.com/piecyk/tsc-webpack-plugin/issues
- npm.io page: https://npm.io/package/tsc-webpack-plugin

## Dependencies (1)

- [node-pty](https://npm.io/package/node-pty.md) ^0.9.0

## 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

- 0.0.4 (latest) — 2020-10-27
- 0.0.3 — 2020-10-26
- 0.0.2 — 2020-10-21
- 0.0.1 — 2020-10-20

## README

# tsc-webpack-plugin

> A TypeScript plugin that runs tsc command and push output to webpack.

## Install

This plugin requires minimum **node 10**, **webpack 4.37.0**

```bash
yarn add -D tsc-webpack-plugin
```

> Example how to configure it with [babel-loader](https://github.com/babel/babel-loader)
> can be found in [**example**](./example) directory.

- [Babel with TypeScript](https://www.typescriptlang.org/docs/handbook/babel-with-typescript.html)
- [What is a tsconfig.json](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html)
- [@babel/preset-typescript](https://babeljs.io/docs/en/babel-preset-typescript)

> Using babel for transpiling, webpack for bundling and tsc for types.

## Usage

In your webpack configuration:

```js
const TscWebpackPlugin = require("tsc-webpack-plugin");

module.exports = {
  mode: "development",
  entry: "./src/index.ts",
  resolve: {
    extensions: [".ts", ".tsx", ".js"],
  },
  module: {
    rules: [
      {
        test: /\.(ts|js)x?$/,
        exclude: /node_modules/,
        loader: "babel-loader",
      },
    ],
  },
  plugins: [new TscWebpackPlugin()],
};
```

## Options

You can pass tsc [CLI Options](https://www.typescriptlang.org/docs/handbook/compiler-options.html) as object to plugin.

For example cli `--build --project ./config/tsconfig.json` will be

```js
const TscWebpackPlugin = require("tsc-webpack-plugin");

module.exports = {
  // ...
  plugins: [
    new TscWebpackPlugin({ build: "", project: "./config/tsconfig.json" }),
  ],
  // ...
};
```

## License

MIT License

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