Separate CLI and API

This commit is contained in:
atjn
2021-05-04 12:57:48 +02:00
parent 650c662ffa
commit b50402e3b3
20 changed files with 2492 additions and 2267 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');
}
}
};
};