@arviahq/vite-plugin-react
v2.1.0
Published
Arvia for React + Vite — compile .arv design system files with HMR and the arvia CLI.
Readme
@arviahq/vite-plugin-react
The all-in-one Arvia package for Vite + TypeScript projects.
npm install -D @arviahq/vite-plugin-reactIncludes:
- Vite plugin —
import { arvia } from "@arviahq/vite-plugin-react" arviaCLI —arvia gen, token docs, Storybook generationarvia-tsc— optional editor/typecheck integration (shim to@arviahq/typescript-plugin)
Type checking
By default the plugin emits .d.ts declarations into .arvia/types (a
self-ignoring, generated folder), so you typecheck .arv imports with plain
tsc. Add a rootDirs overlay to your tsconfig:
{
"compilerOptions": {
"moduleResolution": "bundler", // Vite's default
"rootDirs": ["src", ".arvia/types"],
},
}// package.json
{ "scripts": { "typecheck": "tsc --noEmit" } }Run arvia gen src to materialize the declarations in CI before tsc. See
@arviahq/vite-plugin
for the full dts reference (including 'sibling' and opting out with false).
Optional: file-less types via the TS plugin
Prefer zero generated files and always-fresh in-editor types? Set dts: false
and use the tsserver plugin + arvia-tsc instead:
// tsconfig.json
{ "compilerOptions": { "plugins": [{ "name": "@arviahq/typescript-plugin" }] } }// package.json
{ "scripts": { "typecheck": "arvia-tsc --noEmit" } }Lower-level packages (@arviahq/vite-plugin, @arviahq/typescript-plugin) are dependencies of this package and are not required for normal use.
