0.1.0 • Published 2 years ago

@zotera/esbuild-yaml v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

This plugin allows you to import YAML files with ESBUILD

📦 Installation

npm install --save-dev @zotera/esbuild-yaml

📚 Usage

Add this to your build file

const esbuild = require('esbuild');
const YAMLPlugin = require('@zotera/esbuild-yaml');

const yourConfig = {};

esbuild.build({
  ...yourConfig,
  plugins: [YAMLPlugin()]
});

📚 Configuration

output defaults to json

const YAMLPlugin = require('@zotera/esbuild-yaml');

// Output as text
YAMLPlugin({
  output: 'text',
  parserOptions: {
    // Options from js-yaml
  }
});

// Output as JSON
YAMLPlugin({
  output: 'json',
  parserOptions: {
    // Options from js-yaml
  }
});