Gathering detailed insights and metrics for @fwouts/vite-tsconfig-paths
Gathering detailed insights and metrics for @fwouts/vite-tsconfig-paths
Gathering detailed insights and metrics for @fwouts/vite-tsconfig-paths
Gathering detailed insights and metrics for @fwouts/vite-tsconfig-paths
npm install @fwouts/vite-tsconfig-paths
Typescript
Module System
51.8
Supply Chain
90.7
Quality
74.8
Maintenance
100
Vulnerability
98.6
License
TypeScript (100%)
Total Downloads
124,661
Last Day
48
Last Week
2,394
Last Month
6,437
Last Year
68,778
1,363 Stars
262 Commits
51 Forks
5 Watching
7 Branches
26 Contributors
Latest Version
4.2.1
Package Id
@fwouts/vite-tsconfig-paths@4.2.1
Unpacked Size
90.70 kB
Size
23.27 kB
File Count
16
Publised On
21 Jun 2023
Cumulative downloads
Total Downloads
Last day
-57.9%
48
Compared to previous day
Last week
89.2%
2,394
Compared to previous week
Last month
-10.4%
6,437
Compared to previous month
Last year
23.1%
68,778
Compared to previous year
4
1
👋 Do you like Postgres 🐘? I'm making a 100% type-safe query builder (not an ORM), and I want your help fleshing it out.
Btw, it generates the types and client from your database schema, so it's never out-of-date and you have access to every native Postgres function!
I want to add a powerful plugin system soon, and eventually all functionality will be pluggable.
Give vite
the ability to resolve imports using TypeScript's path mapping.
Install as dev dependency
Inject vite-tsconfig-paths
using the vite.config.ts
module
1import { defineConfig } from 'vite' 2import tsconfigPaths from 'vite-tsconfig-paths' 3 4export default defineConfig({ 5 plugins: [tsconfigPaths()], 6})
Note: You need to restart Vite when you update your paths
mappings.
root: string
The directory to search for tsconfig.json
files.
The default value of this option depends on whether projects
is defined. If it is, then the Vite project root is used. Otherwise, Vite's searchForWorkspaceRoot
function is used.
projects: string[]
If you have an esoteric setup, you might need this option to specify where your tsconfig files are located. The paths within are relative to the root
option.
If defined, the root
directory won't be searched for tsconfig files. You should always try using just the root
option first, because this option is more brittle.
loose: boolean
Disable strictness that limits path resolution to TypeScript and JavaScript importers.
Useful if you want imports in Vue templates to be resolved, but don't want to use allowJs
in your tsconfig, for example.
In other words, when loose: true
is used, any file that gets transpiled into JavaScript will have its imports resolved by this plugin.
parseNative: boolean
Enable use of the tsconfck.parseNative
function, which delegates the loading of tsconfig files to the TypeScript compiler. You'll probably never need this, but I added it just in case.
⚠️ This option can slow down Vite's startup time by as much as 600ms, due to the size of the TypeScript compiler. Only use it when necessary.
ignoreConfigErrors: boolean
When true, parsing errors encountered while loading tsconfig files will be ignored. This is useful if you have a monorepo with multiple tsconfig files, and you don't want to see errors for the ones that aren't relevant to the current project.
If your tsconfig file has "allowJs": true
in it, path resolution will be expanded beyond TypeScript importers. The following extensions will have their imports resolved by this plugin: .vue
, .svelte
, .mdx
, .mjs
, .js
, .jsx
If the baseUrl
is defined, it gets prepended to all bare imports, and its resolution will take precedence over node_modules. This is also how TypeScript does it.
Say the baseUrl
is ../root
and you import react
. This plugin will use ../root/react
if it exists. If not found, then react
is resolved normally. The baseUrl
is relative to the project root (where tsconfig.json
lives).
The include
and exclude
tsconfig options are respected.
Internally, globrex is used for glob matching.
The DEBUG
environment variable can be used to figure out why this plugin isn't working as you may have expected.
1DEBUG=vite-tsconfig-paths yarn vite
Also, check out the Troubleshooting wiki page for more guidance.
No vulnerabilities found.
Reason
29 commit(s) and 22 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 4/30 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
16 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More