Skip to content

Commit 49c896f

Browse files
committed
docs(readme): document that this plugin is obsolete and how to migrate to resolve.extensionAlias
1 parent e64c006 commit 49c896f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,27 @@
33
A webpack plugin to resolve TypeScript files imported using the `.js` extension
44
when using ESM imports.
55

6+
## Obsolete
7+
8+
webpack has equivalent functionality built-in since v5.74.0. This plugin is no
9+
longer needed unless you are using an older version of webpack.
10+
11+
To migrate from this plugin, set `resolve.extensionAlias` in
12+
`webpack.config.js`:
13+
14+
```js
15+
export default {
16+
resolve: {
17+
extensionAlias: {
18+
".js": [".ts", ".js"],
19+
".mjs": [".mts", ".mjs"]
20+
}
21+
}
22+
}
23+
```
24+
25+
and remove `new ResolveTypeScriptPlugin()` from `resolve.plugins`.
26+
627
## Why?
728

829
If you are using webpack in conjunction with TypeScript and ES Modules, you need

0 commit comments

Comments
 (0)