@rvettori/vite-tools
v0.1.0
Published
Shared Vite + TypeScript + JSX runtime tools for RVettori projects.
Downloads
112
Readme
@rvettori/vite-tools
A single package to centralize JSX runtime definitions, TypeScript base config, and Vite alias utilities.
What this package includes
- JSX runtime for
jsxImportSource - Development runtime (
jsx-dev-runtime) for Vite in dev mode tsconfigpreset for web apps- Helper to create legacy alias (
@internal) when needed
Structure
@rvettori/vite-tools/jsx-runtime@rvettori/vite-tools/jsx-dev-runtime@rvettori/vite-tools/tsconfig/web@rvettori/vite-tools/vite
Recommended usage (without internal alias)
1) TypeScript
In the consumer project:
{
"extends": "@rvettori/vite-tools/tsconfig/web",
"compilerOptions": {
"baseUrl": "."
},
"include": ["src"]
}2) Vite
If you do not use @internal, no extra alias is required for the package runtime.
Usage with legacy @internal alias
1) Consumer tsconfig
{
"extends": "@rvettori/vite-tools/tsconfig/web",
"compilerOptions": {
"jsxImportSource": "@internal",
"baseUrl": ".",
"paths": {
"@internal": ["src/internal"],
"@internal/*": ["src/internal/*"]
}
},
"include": ["src"]
}2) Consumer vite.config.ts
import { defineConfig } from 'vite'
import { createInternalAlias } from '@rvettori/vite-tools/vite'
export default defineConfig({
resolve: {
alias: {
...createInternalAlias(import.meta.url),
},
},
})3) Required files in the consumer project
If jsxImportSource is @internal, the project must contain:
src/internal/jsx-runtime.tssrc/internal/jsx-dev-runtime.ts
You can re-export from this package to avoid duplication:
// src/internal/jsx-runtime.ts
export * from '@rvettori/vite-tools/jsx-runtime'// src/internal/jsx-dev-runtime.ts
export * from '@rvettori/vite-tools/jsx-dev-runtime'Package development
bun install
bun run typecheck
bun run build