# @what-src/typescript-plugin

> what-src typescript compiler plugin.

Latest version **1.1.2-alpha.0** (published 2019-10-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @what-src/typescript-plugin
pnpm add @what-src/typescript-plugin
yarn add @what-src/typescript-plugin
bun add @what-src/typescript-plugin
```

## 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.1.2-alpha.0 |
| Published | 2019-10-01 |
| First published | 2019-09-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.9.0 |
| Dependencies | 2 |
| Unpacked size | 23.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Scott Doucet |
| Maintainers | duroktar |

## Links

- npm: https://www.npmjs.com/package/@what-src/typescript-plugin
- Repository: https://github.com/duroktar/what-src/tree/master/packages/what-src-plugin
- npm.io page: https://npm.io/package/@what-src/typescript-plugin

## Dependencies (2)

- [@what-src/utils](https://npm.io/package/@what-src/utils.md) ^1.1.0-alpha.0
- [@what-src/plugin-core](https://npm.io/package/@what-src/plugin-core.md) ^1.1.2-alpha.0

## Recent versions

- 1.1.2-alpha.0 (latest) — 2019-10-01
- 1.1.0-alpha.0 — 2019-09-30

## README

# @what-src/typescript-plugin

> what-src typescript [compiler plugin](https://github.com/microsoft/TypeScript/wiki/Using-the-Compiler-API).

Check out the [packages folder](https://github.com/duroktar/what-src/tree/master/packages)
for more information.

## Usage

First install the package from npm.

```sh
npm install @what-src/typescript-plugin --save-dev
```

### via Webpack (recommended)

Via webpack.config.ts (or .json, .js, ...).

```ts
import devserver from 'webpack-dev-server'
import webpack from 'webpack'
import { whatSrcServerTsLoaderPlugin } from '@what-src/plugin'
import { WhatSrcServerWebpackPlugin } from '@what-src/plugin'

const config: webpack.Configuration & devserver.Configuration = {
  mode: process.env.NODE_ENV,
  module: {
    rules: [
      {
        test: /\.tsx?$/,
        use: [
          {
            loader: 'ts-loader',
            options: {
              getCustomTransformers: () => ({
                before: [whatSrcServerTsLoaderPlugin()],
              }),
            },
          },
        ],
      },
    ],
  },
  plugins: [new WhatSrcServerWebpackPlugin()],
}
```

```json
$ package.json
{
  ...
  "scripts": {
    ...
    "develop": "webpack-dev-server"
  },
  ...
}
```

```sh
npm run develop
```

### Planned Support

- [ttypescript](https://github.com/cevek/ttypescript)
- [custom compiler](https://levelup.gitconnected.com/writing-typescript-custom-ast-transformer-part-1-7585d6916819)

## Example

**Check out the [example project](https://github.com/duroktar/what-src/tree/master/packages/what-src-example-typescript)
for a more in depth setup.**

## License

[MIT](https://opensource.org/licenses/MIT)

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