Skip to content

Commit 166da89

Browse files
authored
docs(guides): add tsconfig-paths-webpack-plugin migration diff (#8191)
1 parent 48d465f commit 166da89

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/content/guides/typescript.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,31 @@ export default {
234234

235235
With the above, `@/components/Button` resolves to `src/components/Button` without any additional plugins or duplicating aliases in `resolve.alias`.
236236

237+
### Migrating from `tsconfig-paths-webpack-plugin`
238+
239+
If you're currently using `tsconfig-paths-webpack-plugin`, you can drop it in favor of the built-in `resolve.tsconfig` option:
240+
241+
```diff
242+
- import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
243+
244+
export default {
245+
resolve: {
246+
- plugins: [new TsconfigPathsPlugin()],
247+
+ // Auto-find tsconfig.json in the project root
248+
+ tsconfig: true,
249+
+
250+
+ // Or explicitly point to one
251+
+ // tsconfig: './tsconfig.app.json'
252+
},
253+
};
254+
```
255+
256+
You can then remove the package from your project:
257+
258+
```bash
259+
npm uninstall tsconfig-paths-webpack-plugin
260+
```
261+
237262
W> `resolve.tsconfig` only handles module resolution — it does not transpile TypeScript. You still need `ts-loader`, `babel-loader` with `@babel/preset-typescript`, or another transpilation step.
238263

239264
## Loader

0 commit comments

Comments
 (0)