Introduce libSquoosh

This commit is contained in:
Surma
2021-05-19 12:15:00 +01:00
parent 25754b91b7
commit 392aced394
19 changed files with 86 additions and 100 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'));
}
},
};
}