1.1.0 • Published 3 years ago

@chronotruck/yaml-loader v1.1.0

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

@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.

MIT