Skip to content

Commit c633381

Browse files
authored
Merge pull request TypeStrong#694 from jonaskello/readme-mention-tsconfig-paths
Mention tsconfig-paths-webpack-plugin in readme. Fixes TypeStrong#693.
2 parents b206368 + 188a9ee commit c633381

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,24 @@ 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+
### `baseUrl` / `paths` module resolution
160+
161+
If you want to resolve modules according to `baseUrl` and `paths` in your `tsconfig.json` then you can use the [tsconfig-paths-webpack-plugin](https://www.npmjs.com/package/tsconfig-paths-webpack-plugin) package. For details about this functionality, see the [module resolution documentation](https://www.typescriptlang.org/docs/handbook/module-resolution.html#base-url).
162+
163+
This feature requires webpack 2.1+ and TypeScript 2.0+. Use the config below or check the [package](https://github.com/dividab/tsconfig-paths-webpack-plugin/blob/master/README.md) for more information on usage.
164+
165+
```js
166+
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
167+
168+
module.exports = {
169+
...
170+
resolve: {
171+
plugins: [new TsconfigPathsPlugin({ /*configFile: "./path/to/tsconfig.json" */ })]
172+
}
173+
...
174+
}
175+
```
176+
159177
### Options
160178

161179
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)