Resolver | Conditional imports | Directory index files | Extensions omitable | Extensions omitted in JS by convention | Extensions omitted in TS by convention | Resolves .ts extension to .ts | Resolves .js extension to .ts | Import ESM | Import CJS | Notes |
---|---|---|---|---|---|---|---|---|---|---|
Vite | yes | yes | yes | no | yes | yes | yes | yes | yes | |
Parcel | no | yes | yes | yes | yes | yes | no | yes | yes | |
esbuild | yes | yes | yes | ? | ? | yes | yes | yes | yes | |
Webpack | yes (as of v5) | yes | yes | yes | yes | yes | with plugin | yes | yes | |
Rollup | with node plugin | with ts plugin | yes | no | ? | no | with ts plugin | yes | yes | ts plugin uses ts.nodeModuleNameResolver |
Node 10 | no | yes | yes | yes | - | yes | no | no | yes | |
Deno | yes | no | no | - | - | yes | no | yes | no | |
Browsers | no | no | no | - | - | yes | no | yes | no | |
tsc --moduleResolution node |
no | yes | yes | yes | yes | no | yes | yes | yes | |
Node 12+ (from CJS) | yes | yes | yes | yes | - | yes | no | async | yes | |
tsc --moduleResolution nodenext (from CJS) |
yes | yes | yes | yes | yes | no | yes | async | yes | |
Node 12+ (from ESM) | yes | no | no | - | - | yes | no | yes | yes | |
tsc --moduleResolution nodenext (from ESM) |
yes | no | no | - | - | no | yes | yes | yes |
-
-
Save andrewbranch/3020c4e24092bd37f7e210d6f050ef26 to your computer and use it in GitHub Desktop.
Popular module resolvers and resolution features they support
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Webpack no longer needs a plugin since version 5.74. You can set
resolve.extensionAlias
.