vite-config-silverwind

raw JSON →
7.0.4 verified Mon Apr 27 auth: no javascript

Shared Vite configuration presets for Node.js library development. Current stable version is 7.0.4, requiring Node >=18 and Vite >=8. Provides pre-configured `nodeLib()` and `browserLib()` presets that handle build, output, and TypeScript settings. Commonly used to standardize Vite configs across monorepos. Differentiates by offering zero-config presets specifically optimized for Node.js and browser library builds, with automatic resolution of import.meta.url for proper output paths. Ships TypeScript definitions.

error Cannot find module 'vite-config-silverwind'
cause Package not installed or missing peer dependency 'vite'.
fix
Run npm install vite-config-silverwind vite@^8
error The requested module 'vite-config-silverwind' does not provide an export named 'default'
cause Attempting default import when only named exports exist.
fix
Use import { nodeLib } from 'vite-config-silverwind'
error Require of ES Module 'vite-config-silverwind' not supported
cause Package is ESM-only; cannot use require().
fix
Use import syntax, or if using CommonJS, convert to ESM or use dynamic import().
breaking Requires Vite >=8. Older Vite versions are incompatible.
fix Upgrade Vite to >=8. If locked to older Vite, use an older version of this package.
breaking Node.js >=18 required. Older Node versions may fail.
fix Upgrade Node.js to >=18.
gotcha import.meta.url must be provided to nodeLib() or browserLib() for correct output paths. Omitting it may produce incorrect paths.
fix Always pass { url: import.meta.url } to the preset function.
npm install vite-config-silverwind
yarn add vite-config-silverwind
pnpm add vite-config-silverwind

Demonstrates basic usage: creating a Vite config for a Node.js library using the nodeLib preset with automatic URL resolution.

import { defineConfig } from 'vite';
import { nodeLib } from 'vite-config-silverwind';

export default defineConfig(nodeLib({ url: import.meta.url }));