typescript-simple-loader
TypeScript icon, indicating that this package has built-in type declarations

0.3.2 • Public • Published

TypeScript Simple Loader

NPM version NPM downloads Build status Test coverage

Feature complete TypeScript loader for webpack.

Webpack Hot Module Replacement with TypeScript

Installation

npm install typescript-simple-loader --save

Features

  • Supports tsconfig.json
  • Supports Source Maps
  • Emits all TypeScript issues (including external dependencies like .d.ts files)
  • Emits semantic diagnostics as webpack warnings (doesn't block compilation)
  • Watches and reloads every compilation dependency (yes, even d.ts files)

Usage

module.exports = {
  entry: './main.ts',
  resolve: {
    extensions: ['', '.ts', '.js']
  },
  module: {
    loaders: [
      {
        test: /\.ts$/,
        loader: 'typescript-simple-loader'
      }
    ]
  }
}

Load tsconfig.json

The loader automatically resolves and parses tsconfig.json, based on the Webpack context, using tsconfig.

Configuration Options

You can set options by using the query string.

loaders: [
  {
    test: /\.ts$/,
    loader: 'typescript-simple-loader?compiler=ntypescript&configFile=tsconfig.json&ignoreWarnings[]=2304'
  }
]
  • compiler Set a custom TypeScript compiler compatible with typescript@>=1.5-alpha
  • configFile Manually set the location of the tsconfig.json file
  • ignoreWarnings Set an array of TypeScript diagnostic codes to ignore

License

MIT

Package Sidebar

Install

npm i typescript-simple-loader@0.3.2

Version

0.3.2

License

MIT

Last publish

Collaborators

  • blakeembrey