JSON
Parcel 支持将 JSON 和 JSON5 文件导入到 JavaScript 中,开箱即用。
¥Parcel supports importing JSON and JSON5 files into JavaScript out of the box.
用法示例
#¥Example usage
app.js:
import data from './data.json';
console.log(data.hello[0]);
// => "world"
data.json:
{
"hello": [
"world",
"computer"
]
}