2.0.1 • Published 5 years ago

@andriepu/rollup-plugin-yaml v2.0.1

Weekly downloads
22
License
-
Repository
-
Last release
5 years ago

rollup-plugin-yaml

Convert .yaml and .yml files to ES6 modules:

// import a single property from a YAML file
import { foo } from './config.yaml';

// import the whole file as an object
import config from './config.yaml';

Installation

npm install --save-dev rollup-plugin-yaml

Usage

import { rollup } from 'rollup';
import yaml from 'rollup-plugin-yaml';

rollup({
  entry: 'main.js',
  plugins: [
    yaml({
      // All YAML files will be parsed by default,
      // but you can also specifically include/exclude files
      include: 'node_modules/**',  // Default: undefined
      exclude: [ 'node_modules/foo/**', 'node_modules/bar/**' ],  // Default: undefined
    })
  ]
});

License

MIT