Astro builds on top of Vite, and supports both Vite and Rollup plugins. This recipe uses a Rollup plugin to add the ability to import a YAML (
.yml) file in Astro.
Import the plugin in your
astro.config.mjs and add it to the Vite plugins array:
Finally, you can import YAML data using an