mirror of
https://github.com/ducbao414/win32.run.git
synced 2025-12-15 16:52:49 +09:00
init the awkward code
This commit is contained in:
16
gen/imports.js
Normal file
16
gen/imports.js
Normal file
@@ -0,0 +1,16 @@
|
||||
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);
|
||||
})()
|
||||
Reference in New Issue
Block a user