Skip to content

Releases: aleclarson/vite-tsconfig-paths

v7.0.0-alpha.1

29 Mar 18:51

Choose a tag to compare

v7.0.0-alpha.1 Pre-release
Pre-release

This release marks a major modernization of vite-tsconfig-paths, moving to the OXC and Rolldown ecosystem for significantly improved performance and a leaner dependency tree.

Special thanks to Ben Snyder (@benpsnyder) for this massive overhaul!

High-Level Changes

  • OXC Resolver Integration: Replaced custom path-matching logic with oxc-resolver. This handles tsconfig paths natively in Rust, providing a high-performance resolution pipeline.
  • Rolldown Ready: Added support for Rolldown-compatible resolveId hook filters. This allows skipping unnecessary JS-to-Rust boundary calls for relative imports and virtual modules on supported engines (Vite 6.3+, Rollup 4.38+, and Rolldown).
  • Toolchain Modernization:
    • Switched from tsup to Rolldown for bundling, reducing transitive dependencies by over 100.
    • Migrated from Prettier to oxfmt (OXC's formatter).
    • Introduced oxlint for fast, type-aware linting.
    • Uses oxc-transform for native .d.ts generation via isolatedDeclarations.
  • TypeScript 6.0: Upgraded to TypeScript 6.0 RC, including fixes for new strictness requirements and deprecations.
  • Performance Wins: Benchmarks show the new implementation is approximately 1.22x faster on the plugin's own test suite and provides measurable wins in real-world AnalogJS targets.

Breaking Changes & Compatibility

  • Node.js >= 18 is now required.
  • Vite >= 5.0.0 is now the minimum supported version.
  • .json Import Guard: The guard now applies to all resolutions (including those from paths), requiring explicit extensions for JSON files if they aren't matched by a specific pattern.
  • Drop-in Replacement: Despite the internal rewrite, all existing test fixtures pass, and the plugin remains a drop-in replacement for most users.

How to try it

This is an alpha release. You can install it using the next tag:

npm install vite-tsconfig-paths@next

v6.1.0

07 Feb 15:40

Choose a tag to compare

Features

  • New importerFilter option: Provides fine-grained control over which files should have their imports resolved by this plugin. (Closes #175, #193)
  • Ignore .d.ts overrides: The plugin now ignores resolutions that point to .d.ts files, avoiding issues when tsconfig is used for opt-in type overrides. (Closes #179, #180)

Performance

  • Hoisted regular expressions out of the hot path in the resolver for better performance.

Internal

  • Added resolvedToDeclarationFile event to the debug log file.

v6.0.0

14 Dec 22:13

Choose a tag to compare

Note: No intentional breaking changes. Major version bump due to extensive internal refactoring; downgrade to v5 if needed.

Highlights

  • On-demand tsconfig discovery via projectDiscovery: "lazy", while eager discovery remains the default.
  • tsconfig/jsconfig files are watched and reloaded automatically in both modes, including during vite build --watch.
  • New logFile option for per-import resolution traces (pass true for vite-tsconfig-paths.log or provide a path).
  • Support for root /* aliases and other absolute-style imports.
  • Support for .astro files when allowJs/loose is enabled.

Fixes

  • More reliable tsconfig watching and resolver refreshes: handles lazy discovery edge cases, recreates resolvers after file changes, tolerates missing directories, and copes better with virtual importers.
  • Windows path handling now normalizes drive-letter casing to avoid missed matches (#183).

Upgrade notes

  • Install the stable release: pnpm add -D vite-tsconfig-paths.
  • Opt into lazy discovery or logging when needed:
import tsconfigPaths from 'vite-tsconfig-paths'

export default {
  plugins: [
    tsconfigPaths({
      projectDiscovery: 'lazy',
      logFile: true,
    }),
  ],
}
  • Rooted path patterns such as "/*": ["src/*"] now resolve the same way tsserver does.

v6.0.0-beta.4

01 Aug 03:07

Choose a tag to compare

v6.0.0-beta.4 Pre-release
Pre-release
  • fix(windows): ensure drive letter is uppercase (#183)
  • feat: add .astro to JS-like extension regex (fbbc8ed)

v6.0.0-beta.3

16 Apr 19:28

Choose a tag to compare

v6.0.0-beta.3 Pre-release
Pre-release
  • Added support for /* path aliases. (#101)

v6.0.0-beta.2

16 Apr 18:58

Choose a tag to compare

v6.0.0-beta.2 Pre-release
Pre-release
  • Added a new logFile option.
    Pass logFile: true and the plugin will create a vite-tsconfig-paths.log file in your working directory.

    Using DEBUG=vite-tsconfig-paths in the past has worked pretty well, but it isn't always the most readable. In v6 and above, this plugin will still have debug logs using this approach, but module resolution will only be logged through the new logFile option. The log file will be comprehensive (as in, every import that vite-tsconfig-paths receives will be logged). If an import goes unhandled by this plugin, the reason will be logged. If an import is resolved, the resolved path and the tsconfig path are both logged. In fact, every possible code path (in the context of module resolution) is logged to the log file.

  • Universal support for tsconfig reloading.
    Whether you're using projectDiscovery: "lazy" or eager loading, this plugin should now be able to watch and reload tsconfig files when you make changes to them. This feature hasn't been rigorously tested yet. Please report issues you come across.

  • Support for vite build --watch.
    The buildStart hook will reset the plugin whenever it's called.

v6.0.0-beta.1

16 Apr 03:04

Choose a tag to compare

v6.0.0-beta.1 Pre-release
Pre-release
  • Added a new projectDiscovery option.

    When this option is set to "lazy", tsconfig files will be loaded on-demand. When an import is resolved, the parent directories of the importer are searched for tsconfig files matching the configNames array option (which defaults to ["tsconfig.json", "jsconfig.json"]).

    If using TypeScript’s project references, you can ensure they are discovered by adding the main project to the projects array option of this plugin. Though, this is only necessary if you’re referencing tsconfig files with non-standard names (e.g. "tsconfig.src.json"). Setting the projects option will not interfere with lazy project discovery.

v5.1.4

06 Dec 16:28

Choose a tag to compare

  • fix: correctly infer the paths root dir (eea1c17) (#150)

v5.1.3

19 Nov 20:53

Choose a tag to compare

  • fix: Once an importer is matched, end directory traversal (b0d8ecb)
  • feat: Add vite-tsconfig-paths:resolve debug logs (7160d6e)
  • chore: Ensure debug logs can be enabled in vitest (0dc9a8b)

v5.1.2

10 Nov 16:56

Choose a tag to compare

  • fix Windows regression introduced in v5.1.1 (#162)