Skip to content

Commit 591bd10

Browse files
e56johnnyreilly
andauthored
update docs for latest webpack 5 syntax (#1244)
Co-authored-by: John Reilly <[email protected]>
1 parent e9c2677 commit 591bd10

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,12 +729,22 @@ In order to make use of this option your project needs to be correctly configure
729729
Because TS will generate .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:
730730

731731
```javascript
732+
// for webpack 4
732733
plugins: [
733734
new webpack.WatchIgnorePlugin([
734735
/\.js$/,
735736
/\.d\.ts$/
736737
])
737738
],
739+
740+
// for webpack 5
741+
plugins: [
742+
new webpack.WatchIgnorePlugin(
743+
paths:{[
744+
/\.js$/,
745+
/\.d\.ts$/
746+
]})
747+
],
738748
```
739749

740750
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.

0 commit comments

Comments
 (0)