Skip to content

Commit 7859d86

Browse files
committed
Mention tsconfig-paths-webpack-plugin in readme. Fixes TypeStrong#693.
1 parent b206368 commit 7859d86

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,22 @@ The build **should** fail on TypeScript compilation errors as of webpack 2. If f
156156

157157
For more background have a read of [this issue](https://github.com/TypeStrong/ts-loader/issues/108).
158158

159+
### Tsconfig paths resolution
160+
161+
If you want to resolve modules according to `baseUrl` and `paths` in tsconfig.json (new feature of TS 2.0) then please install the [tsconfig-paths-webpack-plugin](https://www.npmjs.com/package/tsconfig-paths-webpack-plugin) package. This feature requires webpack 2.1 or later. Use the config below or check the [readme](https://github.com/dividab/tsconfig-paths-webpack-plugin/blob/master/README.md) for more information.
162+
163+
```js
164+
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
165+
166+
module.exports = {
167+
...
168+
resolve: {
169+
plugins: [new TsconfigPathsPlugin({ /*configFile: "./path/to/tsconfig.json" */ })]
170+
}
171+
...
172+
}
173+
```
174+
159175
### Options
160176

161177
There are two types of options: TypeScript options (aka "compiler options") and loader options. TypeScript options should be set using a tsconfig.json file. Loader options can be specified through the `options` property in the webpack configuration:

0 commit comments

Comments
 (0)