edge-fe-meta-loader for Webpack
JS-YAML loader for webpack.
Installation
npm install edge-fe-meta-loader
Usage
Webpack documentation on using loaders.
Using the loader inline:
import doc from 'edge-fe-meta-loader!./file.yml';
// => returns a javascript object. see https://github.com/nodeca/js-yaml
Or using the loader via Webpack configuration (recommended):
// webpack.config.js
module: {
rules: [{
test: /\.mt\.ya?ml$/,
use: 'edge-fe-meta-loader',
}]
}
In contrast, this loader loads YAML files as JavaScript objects using the
un-eval library. This allows YAML value
types otherwise disallowed in JSON such as Infinity
, RegExp
, Function
,
etc. See js-yaml's supported YAML types