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