Releases: aleclarson/vite-tsconfig-paths
v6.0.0-beta.4
v6.0.0-beta.3
- Added support for
/*
path aliases. (#101)
v6.0.0-beta.2
-
Added a new
logFile
option.
PasslogFile: true
and the plugin will create avite-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 newlogFile
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 usingprojectDiscovery: "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
.
ThebuildStart
hook will reset the plugin whenever it's called.
v6.0.0-beta.1
-
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 theprojects
option will not interfere with lazy project discovery.
v5.1.4
v5.1.3
v5.1.2
v5.1.1
v5.1.0
- Add
skip
option for adding additional directories to be skipped when searching for tsconfig.json files (#146) - Fix path resolution on Windows when other Vite plugins neglect to normalize the
importer
path before callingthis.resolve
in theirresolveId
hooks (#157) - Allow both tsconfig.json and jsconfig.json in the same directory (4124b09)
v5.0.0
This package is now ESM only in order to align with Vite: https://vitejs.dev/guide/migration#deprecate-cjs-node-api
If your project is using CommonJS, you can rename your Vite config to use the .mjs
or .mts
extension (depending on whether you use TypeScript or not). If you're not using Vite v5.0.0+, you may want to pin your dependency to v4 of this plugin.