refactor: simplify script paths
This commit is contained in:
parent
c499afb246
commit
531266f93e
|
@ -33,7 +33,7 @@ export default class Script {
|
||||||
import.meta.hot.accept('./scripts.js', ({default: scripts}) => {
|
import.meta.hot.accept('./scripts.js', ({default: scripts}) => {
|
||||||
const ref = hotRef.deref();
|
const ref = hotRef.deref();
|
||||||
if (ref) {
|
if (ref) {
|
||||||
ref.fn = scripts[`../..${path}`];
|
ref.fn = scripts[path];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ export default class Script {
|
||||||
|
|
||||||
function register({default: scripts}) {
|
function register({default: scripts}) {
|
||||||
for (const path in scripts) {
|
for (const path in scripts) {
|
||||||
Script.register(path.slice('../..'.length), scripts[path]);
|
Script.register(path, scripts[path]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
export default import.meta.glob(
|
export default import.meta.glob(
|
||||||
'../../resources/**/*.js',
|
'%/**/*.js',
|
||||||
{eager: true, import: 'default'},
|
{eager: true, import: 'default'},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user