2.3.0 • Published 3 months ago

multi-yaml-loader v2.3.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 months ago

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

2.3.0

3 months ago

2.2.0

5 months ago

1.6.0

2 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.2

4 years ago

1.2.1

4 years ago