vite-plugin-yaml
vite-plugin-yaml copied to clipboard
Possible to include other yaml-files inside a yaml-file?
I'm looking for a way to separate my yaml-files into different files and combine them into 1 big yaml-file.
The yaml-loader I used for Webpack was able to do this : https://github.com/ngfk/yaml-import-loader
The !import statement proved to be very powerful. I would love to have this with this loader as well.
Are there any plans to add something like this?
Apologies for the months-late reply - this is an interesting concept that we're open to supporting! I would love to know more details on the most desirable combination mechanism and some example use cases.
What would the desired behavior be around duplicate keys? Should they cascade where (for example)
!import ./import-1.yml
!import ./import-2.yml
import-2 overrides any keys of the same value in import-1? Similar to in JS:
console.log(
{
foo: 'bar',
...{foo: 2}
}
); // -> foo: 2
Yeah, I guess the second would override previous declared values. However, I want to combine different sections into one file, and will not override values anyway.