Skip to content

Commit 75fbbe7

Browse files
authored
docs: add tsconfig info for client types (#7745)
1 parent 496cea9 commit 75fbbe7

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/content/guides/typescript.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,18 @@ It's possible to use webpack specific features in your TypeScript code, such as
224224
console.log(import.meta.webpack); // without reference declared above, TypeScript will throw an error
225225
```
226226

227+
To enable the types for the whole project, add `webpack/module` to `compilerOptions.types` in `tsconfig.json`:
228+
229+
```diff
230+
{
231+
"compilerOptions": {
232+
"types": [
233+
+ "webpack/module"
234+
]
235+
}
236+
}
237+
```
238+
227239
## Using Third Party Libraries
228240

229241
When installing third party libraries from npm, it is important to remember to install the typing definition for that library.

0 commit comments

Comments
 (0)