Add Babel to fix Node <14 compat

This commit is contained in:
Jason Miller
2020-10-05 22:45:36 -04:00
parent 09f65d0cd7
commit 4487da9e9e
5 changed files with 1725 additions and 17 deletions

View File

@@ -0,0 +1,12 @@
import { promises as fsp } from 'fs';
export default function autojsonPlugin() {
return {
name: 'autojson-plugin',
async load(id) {
if (id.endsWith('.json') && !id.startsWith('json:')) {
return 'export default ' + await fsp.readFile(id, 'utf8');
}
}
};
};