refactor: simplify script paths

This commit is contained in:
cha0s 2024-10-21 08:01:22 -05:00
parent c499afb246
commit 531266f93e
2 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ export default class Script {
import.meta.hot.accept('./scripts.js', ({default: scripts}) => {
const ref = hotRef.deref();
if (ref) {
ref.fn = scripts[`../..${path}`];
ref.fn = scripts[path];
}
});
}
@ -101,7 +101,7 @@ export default class Script {
function register({default: scripts}) {
for (const path in scripts) {
Script.register(path.slice('../..'.length), scripts[path]);
Script.register(path, scripts[path]);
}
}

View File

@ -1,5 +1,5 @@
export default import.meta.glob(
'../../resources/**/*.js',
'%/**/*.js',
{eager: true, import: 'default'},
);