Move dev-only hooks into their own folder that isn't included in the build
This commit is contained in:
parent
8de63e91c7
commit
803c1673e2
7 changed files with 37 additions and 4 deletions
|
|
@ -1,16 +0,0 @@
|
|||
import { Logger } from "../utils/Logger.mjs";
|
||||
|
||||
const loaders = {
|
||||
svg(data) {
|
||||
const iconName = data.path.split(`/`).slice(-1)[0].slice(0, -4);
|
||||
Logger.debug(`hot-reloading icon: ${iconName}`);
|
||||
Hooks.call(`${game.system.id}-hmr:svg`, iconName, data);
|
||||
},
|
||||
mjs() {window.location.reload()},
|
||||
css() {window.location.reload()},
|
||||
};
|
||||
|
||||
Hooks.on(`hotReload`, async (data) => {
|
||||
if (!loaders[data.extension]) {return}
|
||||
return loaders[data.extension](data);
|
||||
});
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
// Hooks
|
||||
import "./hooks/init.mjs";
|
||||
import "./hooks/ready.mjs";
|
||||
import "./hooks/hotReload.mjs";
|
||||
|
||||
// Global API
|
||||
import "./api.mjs";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue