Skip to content

Commit 12f7095

Browse files
committed
maybe this?
1 parent acf9578 commit 12f7095

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

apps/svelte.dev/scripts/get_svelte_template.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ import {
1010
writeFileSync
1111
} from 'node:fs';
1212
import { join } from 'node:path';
13+
import { fileURLToPath } from 'node:url';
1314

1415
// This download the currente Vite template from Github, adjusts it to our needs, and saves it to static/svelte-template.json
1516
// This is used by the Svelte REPL as part of the "download project" feature
1617

1718
const force = process.env.FORCE_UPDATE === 'true';
18-
const output_file = 'static/svelte-template.json';
19-
const output_dir = 'scripts/svelte-template';
19+
const output_file = fileURLToPath(new URL('../static/svelte-template.json', import.meta.url));
20+
const output_dir = fileURLToPath(new URL('./svelte-template', import.meta.url));
2021

2122
try {
2223
if (!force && statSync(output_file)) {
@@ -40,7 +41,10 @@ try {
4041

4142
// add what we need
4243
mkdirSync(join(output_dir, 'public'));
43-
copyFileSync('static/favicon.png', join(output_dir, 'public/favicon.png'));
44+
copyFileSync(
45+
fileURLToPath(new URL('../static/favicon.png')),
46+
join(output_dir, 'public/favicon.png')
47+
);
4448

4549
// build svelte-app.json
4650
const files = [];

0 commit comments

Comments
 (0)