@chronotruck/yaml-loader
v1.1.0
Published
YAML to JS loader for Webpack
Downloads
414
Readme
@chronotruck/yaml-loader
YAML loader for Webpack. Allows importing YAML files as JS objects. Uses yaml
internally.
Installation
npm install --save-dev @chronotruck/yaml-loader
Usage
// webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.ya?ml$/,
use: '@chronotruck/yaml-loader'
}
]
}
}
# file.yaml
---
config:
js:
key: test
hello: world
// application.js
import file from './file.yaml'
file.hello === 'world'
License
Forked from https://github.com/eemeli/yaml-loader and simplified for our own specific case.