Webpack loader for YAML files with !include
tag support. Based on github.com/eemeli/yaml
npm install multi-yaml-loader --save
{
...
module: {
...
rules: [
...
{
test: /\.ya?ml$/,
use: 'multi-yaml-loader'
}
]
}
}
title: Main file
sub: !include './relative/path/to/sub.yaml'
# cycle includes also possible, for example
# self: ./file.yaml
/**
* Result by default contains JSON with included documents as objects crosslinks (maybe cyclic =)
*/
const yaml = require('./path/to/file.yaml');
Module defines YamlIncludeError extends Error
npm test
MIT