Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to include other yaml-files inside a yaml-file? #19

Open
Dylan190774 opened this issue Aug 29, 2023 · 2 comments
Open

Possible to include other yaml-files inside a yaml-file? #19

Dylan190774 opened this issue Aug 29, 2023 · 2 comments

Comments

@Dylan190774
Copy link

Dylan190774 commented Aug 29, 2023

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?

@tonyketcham
Copy link
Collaborator

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

@Dylan190774
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants