Vite plugin to import YAML files (.yaml/.yml) as JavaScript modules, using js-yaml internally. Version 2.0.4, actively maintained, minimal dependencies (only js-yaml as a dependency, vite as peer). Key differentiator: lightweight alternative to vite-plugin-yaml, supports TypeScript declaration augmentation, configurable file matching and yaml options. Suitable for Vite projects needing YAML data imports with zero configuration overhead.
npm install vite-yaml-pluginVerified import paths — ran on the pinned version, not inferred.
Shows basic setup of the plugin in vite.config.js and usage in a module, plus TypeScript type augmentation.
Use `yamlPlugin()` instead of `yamlPlugin` in the plugins array.
Add 'vite-yaml-plugin/types' to the 'types' array in tsconfig.json.
Update to v2 and use named import { yamlPlugin } from 'vite-yaml-plugin'.Add 'vite-yaml-plugin/types' to compilerOptions.types in tsconfig.json, or provide a custom declaration file.
Change import statement to: import { yamlPlugin } from 'vite-yaml-plugin'Use `yamlPlugin()` with parentheses in the plugins array.
No dependency data recorded yet.