mirror of
https://github.com/ducbao414/win32.run.git
synced 2025-12-15 08:42:49 +09:00
16 lines
486 B
JavaScript
16 lines
486 B
JavaScript
import path from 'path';
|
|
import dir from 'node-dir';
|
|
|
|
(async () => {
|
|
let files = dir.files('./src/routes/', {sync: true}).filter(file => path.extname(file) == '.svelte');
|
|
let statements = '';
|
|
for(let file of files){
|
|
let import_path = file.split('src/routes/').join('./')
|
|
statements = statements + `
|
|
else if(url == '${import_path}'){
|
|
page = (await import('${import_path}')).default;
|
|
|
|
}`
|
|
}
|
|
console.log(statements);
|
|
})() |