🚀 Release v1.9.10
🌟 New Features & Enhancements
-
Configurable Bare Package Subpath Resolution (
resolvePackageSubpaths) :
You can now explicitly control whether--resolve-full-pathsappends extensions to third-party package subpaths (e.g.,next/font/google).When using bundlers or packages without an
exportsfield (like Next.js), you can prevent unwanted file extensions from breaking virtual/magic imports.
⚙️ How to use
Via tsconfig.json
{
"compilerOptions": {
"moduleResolution": "node"
},
"tsc-alias": {
"resolveFullPaths": true,
"resolvePackageSubpaths": false
}
}Via CLI
# Keep relative and alias extensions, but preserve bare package subpaths
tsc-alias --resolve-full-paths --no-resolve-package-subpathsVia API
await replaceTscAliasPaths({
resolveFullPaths: true,
resolvePackageSubpaths: false
});🐛 Bug Fixes & Smarter Defaults
- Default to
falseformoduleResolution: "bundler": If yourtsconfig.jsonspecifies"moduleResolution": "bundler"(or"Bundler"), bare package subpaths are automatically preserved as written by default. - Full opt-out for
moduleResolution: "node": Libraries built for bundlers with"moduleResolution": "node"can now cleanly opt out without staying locked on v1.9.7.