serialize bigint AST, albeit incorrectly

pull/14504/head
Rich Harris 2 years ago
parent abb90d8737
commit 3049e7ca9a

@ -46,7 +46,14 @@ for (const generate of /** @type {const} */ (['client', 'server'])) {
modern: true
});
fs.writeFileSync(`${cwd}/output/${file}.json`, JSON.stringify(ast, null, '\t'));
fs.writeFileSync(
`${cwd}/output/${file}.json`,
JSON.stringify(
ast,
(key, value) => (typeof value === 'bigint' ? ['BigInt', value.toString()] : value),
'\t'
)
);
try {
const migrated = migrate(source);

Loading…
Cancel
Save