node 16 compat

This commit is contained in:
Felix Roos 2022-06-15 21:34:56 +02:00
parent affce4a4a1
commit fb8dd537e0

View File

@ -1,8 +1,10 @@
import nunjucks from 'nunjucks';
import jsdoc from '../doc.json' assert { type: 'json' };
// TODO: load tutorial.mdx and append rendered api.mdx to the bottom (to make sure TOC works)
// TODO: split
import { readFile } from 'node:fs/promises';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
const __dirname = dirname(fileURLToPath(import.meta.url));
const jsdoc = JSON.parse(await readFile(`${__dirname}/../doc.json`, 'utf8'));
// import jsdoc from '../doc.json' assert { type: 'json' }; // node 18
const env = nunjucks.configure('.', { autoescape: false });