Skip to content

Commit 5563bb7

Browse files
authored
docs: add information about generating .d.ts files to readme (#51)
1 parent 352067b commit 5563bb7

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,26 @@ Add it to _plugins_ in your _tsconfig.json_
3131
}
3232
```
3333

34-
See https://github.com/LeDDGroup/typescript-transform-paths/issues/4#issuecomment-486380340 for generating declaration files.
34+
### Transforming declatation paths
35+
36+
If you want to generate declaration (_.d.ts_) files with transformed paths you have to
37+
modify your _tsconfig.json_ file:
38+
39+
```json
40+
"compilerOptions": {
41+
"baseUrl": "./",
42+
"paths": {
43+
"@utils/*": ["utils/*"]
44+
},
45+
"declaration": true,
46+
"plugins": [
47+
{ "transform": "typescript-transform-paths" },
48+
{ "transform": "typescript-transform-paths", "afterDeclarations": true }
49+
]
50+
}
51+
```
52+
53+
See [issue4](https://github.com/LeDDGroup/typescript-transform-paths/issues/4#issuecomment-486380340) for more information.
3554

3655
## Example
3756

@@ -93,6 +112,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
93112

94113
<!-- markdownlint-enable -->
95114
<!-- prettier-ignore-end -->
115+
96116
<!-- ALL-CONTRIBUTORS-LIST:END -->
97117

98-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
118+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors)
119+
specification. Contributions of any kind welcome!

0 commit comments

Comments
 (0)