<commit_before># TypeScript loader for webpack

## Usage

### Installation

```
npm install ts-loader
```

### Upgrading

Take advantage of the [Changelog](CHANGELOG.md) and [Upgrade Guide](UPGRADE.md).

### Running

Use webpack like normal, including `webpack --watch` and `webpack-dev-server`, or through another
build system using the [Node.js API](http://webpack.github.io/docs/node.js-api.html).

### Configuration

1. Add `.ts` as a resolvable extension.
2. Configure all files with a `.ts` extension to be handled by `ts-loader`.

```
module.exports = {
    entry: './app.ts',
    resolve: {
        extensions: ['', '.webpack.js', '.web.js', '.js', '.ts']
    },
    module: {
        loaders: [
            { test: /\.ts$/, loader: 'ts-loader' }
        ]
    }
}
```

#### Options

Most TypeScript-related options should be set using a 
[tsconfig.json](https://github.com/Microsoft/TypeScript/wiki/tsconfig.json)
file. There are a few loader-specific options you can set although in general
you should not need to.

##### compiler *(string) (default='typescript')*

Allows use of TypeScript compilers other than the official one. Should be
set to the NPM name of the compiler.<commit_msg>Make .ts files come before .js files in README example config.<commit_after># TypeScript loader for webpack

## Usage

### Installation

```
npm install ts-loader
```

### Upgrading

Take advantage of the [Changelog](CHANGELOG.md) and [Upgrade Guide](UPGRADE.md).

### Running

Use webpack like normal, including `webpack --watch` and `webpack-dev-server`, or through another
build system using the [Node.js API](http://webpack.github.io/docs/node.js-api.html).

### Configuration

1. Add `.ts` as a resolvable extension.
2. Configure all files with a `.ts` extension to be handled by `ts-loader`.

```
module.exports = {
    entry: './app.ts',
    resolve: {
        extensions: ['', '.webpack.js', '.web.js', '.ts', '.js']
    },
    module: {
        loaders: [
            { test: /\.ts$/, loader: 'ts-loader' }
        ]
    }
}
```

#### Options

Most TypeScript-related options should be set using a 
[tsconfig.json](https://github.com/Microsoft/TypeScript/wiki/tsconfig.json)
file. There are a few loader-specific options you can set although in general
you should not need to.

##### compiler *(string) (default='typescript')*

Allows use of TypeScript compilers other than the official one. Should be
set to the NPM name of the compiler.
{'fraction_non_alphanumeric': 0.14519427402862986, 'fraction_numerical': 0.0016359918200408998, 'mean_word_length': 3.3523131672597866, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3031760', 'n_tokens_mistral': 765, 'n_tokens_neox': 748, 'n_words': 259}