multi-yaml-loader
TypeScript icon, indicating that this package has built-in type declarations

2.3.0 • Public • Published

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

Package Sidebar

Install

npm i multi-yaml-loader

Weekly Downloads

135

Version

2.3.0

License

MIT

Unpacked Size

1.46 MB

Total Files

45

Last publish

Collaborators

  • maetchkin