You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/sites/svelte.dev/scripts/generate_examples.js

16 lines
460 B

import { get_examples_data } from '../src/lib/server/examples/index.js';
import fs from 'node:fs';
const examples_data = get_examples_data(
new URL('../../../documentation/examples', import.meta.url).pathname
);
try {
fs.mkdirSync(new URL('../src/lib/generated/', import.meta.url), { recursive: true });
} catch {}
fs.writeFileSync(
new URL('../src/lib/generated/examples-data.js', import.meta.url),
`export default ${JSON.stringify(examples_data)}`
);