Skip to content

Commit e85adf8

Browse files
committed
extract common prefix
2 parents 8a6ba1d + e922d72 commit e85adf8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

playgrounds/basic/start.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@ import serve from 'rollup-plugin-serve';
66
import * as svelte from '../../packages/svelte/src/compiler/index.js';
77

88
const __dirname = fileURLToPath(new URL('.', import.meta.url));
9+
const runtime_path = path.resolve(__dirname, '../../packages/svelte/src/runtime');
910

1011
/** @returns {import('rollup').Plugin}*/
1112
function create_plugin(ssr = false) {
1213
return {
1314
name: 'custom-svelte-ssr-' + ssr,
1415
resolveId(id) {
1516
if (id === 'svelte') {
16-
return path.resolve(
17-
__dirname,
18-
ssr ? '../../packages/svelte/src/runtime/ssr.js' : '../../packages/svelte/src/runtime/index.js'
19-
);
17+
return path.resolve(runtime_path, ssr ? 'ssr.js' : 'index.js');
2018
} else if (id.startsWith('svelte/')) {
21-
return path.resolve(__dirname, `../../packages/svelte/src/runtime/${id.slice(7)}/index.js`);
19+
return path.resolve(runtime_path, `${id.slice(7)}/index.js`);
2220
}
2321
},
2422
transform(code, id) {

0 commit comments

Comments
 (0)