@reactway/webpack-builder-plugin-typescript
TypeScript icon, indicating that this package has built-in type declarations

2.0.4 • Public • Published

@reactway/webpack-builder-plugin-typescript

A plugin made for webpack-builder.

Getting started

$ npm i @reactway/webpack-builder-plugin-typescript

Add plugin into webpack config by using use() builder method.

const webpackBuilder = require("@reactway/webpack-builder");
const typeScript = require("@reactway/webpack-builder-plugin-typescript");

module.exports = new webpackBuilder.Builder(__dirname, {
    entry: "./src/app.js",
    output: {
        path: "./dist",
        filename: "[name].bundle.js"
    }
})
    .use(typeScript.TypeScriptPlugin)
    .toConfig();

Works well with react typescript version. If you are planning to use json be sure add

"linterOptions": {
    "exclude": [
      "*.json",
      "**/*.json"
    ]
  }

at tslint.json file.

Passing options

It have wrapped fork-ts-checker-webpack-plugin and tsconfig-paths-webpack-plugin. You can pass both plugin options separate.

const webpackBuilder = require("@reactway/webpack-builder");
const typeScript = require("@reactway/webpack-builder-plugin-typescript");

module.exports = new webpackBuilder.Builder(__dirname, {
    entry: "./src/app.js",
    output: {
        path: "./dist",
        filename: "[name].bundle.js"
    }
})
    .use(typeScript.TypeScriptPlugin, {
        forkTsCheckerOptions: {
            formatter: "codeframe",
            silent: true,
            ...
        },
        ...
    })
    .toConfig();

Documentation

WIP

License

Released under the MIT license.

/@reactway/webpack-builder-plugin-typescript/

    Package Sidebar

    Install

    npm i @reactway/webpack-builder-plugin-typescript

    Weekly Downloads

    2

    Version

    2.0.4

    License

    MIT

    Unpacked Size

    41.8 kB

    Total Files

    11

    Last publish

    Collaborators

    • martynas-zilinskas
    • quatrodev
    • reactway-dev