antfu / esbuild-node-loader

Transpile TypeScript to ESM with Node.js loader.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support file extension ".json"

molvqingtai opened this issue · comments

Since esbuild supports '.json', if it could support direct import of json files

then we could write this in the build script instead of using fs.readJSON

 import { version } from './package.json'

Reference: https://esbuild.github.io/content-types/#json

Should be straightforward to implement, pr welcome