Skip to content

Commit

Permalink
Merge pull request #670 from ORESoftware/patch-1
Browse files Browse the repository at this point in the history
demonstrate usability with watchers, such as webpack --watch
  • Loading branch information
johnnyreilly committed Oct 24, 2017
2 parents 3fcb7e9 + 9136ec4 commit cc1c037
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Expand Up @@ -415,6 +415,19 @@ Or if you want to use only tsx, just use the `appendTsxSuffixTo` option only:
}
})
```

### Usage with Webpack watch

Because TS will generated .js and .d.ts files, you should ignore these files, otherwise watchers may go into an infinite watch loop. For example, when using Webpack, you may wish to add this to your webpack.conf.js file:

```js
plugins: [
new webpack.WatchIgnorePlugin([
/\.js$/,
/\.d\.ts$/
])
],
```

It's worth noting that use of the `LoaderOptionsPlugin` is [only supposed to be a stopgap measure](https://webpack.js.org/plugins/loader-options-plugin/). You may want to look at removing it entirely.

Expand Down

0 comments on commit cc1c037

Please sign in to comment.