Note: This page covers Parcel 1, the documentation for Parcel 2 is being worked on here: parcel2.zcopy.site

YAML

支持扩展类型: yaml, yml

导入 yaml 文件到你的 js import data from './filename.yaml'

例子:

.
├── package.json
└── src
    ├── data.yaml
    └── index.js
# data.yaml

hello:
  - world
  - computer
// index.js

import data from './data.yaml'
console.log(data.hello[0])

// "world"