A Babel macro for loading YAML files
npm install yaml.macroA Babel macro for loading YAML files.
```
npm install --save-dev yaml.macro
Source:
`yaml`file.yaml
- YAML file
- with: some contents
`js
import yaml from 'yaml.macro'
const foo = yaml('./file.yaml')
`
Result:
`js`
const foo = ['YAML file', { with: 'some contents' }];
Relative path values should start with .. Internally, the macro uses yaml and supports its parser options` as a second argument. As the macro arguments are evaluated at build time, they should not be dynamically modified by preceding code.
Multiple calls to load the same YAML file will not be cached.