A Vite plugin (v0.1.1, latest) that allows extending Vite configuration via a `vite` field in package.json. Developed by Anthony Fu, it provides a declarative, JSON-based alternative to vite.config.ts for static config like resolve aliases and build output, making it easier to share and manipulate config across tools. It requires Vite ^2.0.0, ships TypeScript types, and has a minimal API — just one function call.
npm install vite-plugin-package-configVerified import paths — ran on the pinned version, not inferred.
Shows how to install and use the plugin to extend Vite config from package.json's 'vite' field.
Use vite.config.ts for dynamic configurations.
Explicitly set precedence by ordering plugins or using the 'enforce' property.
Use Vite's official config fields like 'outDir' instead of 'output'.
Ensure process.cwd() matches the directory containing package.json, or set root in Vite config.
Run 'npm install -D vite-plugin-package-config'.
Use 'import PkgConfig from "vite-plugin-package-config"'.
Ignore the warning; the plugin parses it correctly.