yaml-patch-loader
v0.1.0
Published
[![npm][npm-badge]][npm-url] [![github][github-badge]][github-url] ![node][node-badge]
Readme
yaml-patch-loader
A webpack loader that converts YAML to JSON with optional transformation
Installation
npm install yaml-patch-loader --save-devFeatures
- Converts YAML files to JSON
- Formats output when webpack's
optimization.minimizeis nottrue - Supports callback function to modify JSON content
Usage
Webpack Configuration
module.exports = {
module: {
rules: [
{
test: /\.ya?ml$/,
use: {
loader: 'yaml-patch-loader',
options: {
// Optional callback to modify parsed data
modify: (data) => {
// Modify data here
return data;
}
}
}
}
]
}
};Options
- modify
{Function}(optional): A function that receives the parsed YAML data and returns the modified data.
