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/playgrounds/demo/scripts/create-app-svelte.js

14 lines
353 B

import fs from 'node:fs';
const destination = new URL('../src/main.svelte', import.meta.url);
if (!fs.existsSync(destination)) {
const template = new URL('./main.template.svelte', import.meta.url);
try {
fs.mkdirSync(new URL('../src', import.meta.url));
} catch {}
fs.writeFileSync(destination, fs.readFileSync(template, 'utf-8'), 'utf-8');
}