Add Hot Module Replacement for SVG icons using the custom component
This commit is contained in:
parent
f15f3a4456
commit
fde3881653
2 changed files with 29 additions and 9 deletions
|
|
@ -3,8 +3,8 @@ import * as hbs from "../handlebars.mjs";
|
|||
const loaders = {
|
||||
svg(data) {
|
||||
const iconName = data.path.split(`/`).slice(-1)[0].slice(0, -4);
|
||||
console.log(`.dungeon | hot-reloading icon: ${iconName}`);
|
||||
CONFIG.CACHE.icons[iconName] = data.content;
|
||||
console.debug(`.dungeon | hot-reloading icon: ${iconName}`);
|
||||
Hooks.call(`dd-hmr:svg`, iconName, data);
|
||||
},
|
||||
hbs(data) {
|
||||
if (!hbs.partials.some(p => data.path.endsWith(p))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue