cactbot icon indicating copy to clipboard operation
cactbot copied to clipboard

build: Add Hot Reloading for Raidboss Skins

Open panicstevenson opened this issue 2 years ago • 3 comments

Summary

Webpack currently does not hot reload skins within the skins folder like it does changes to the raidboss.css file, which makes new skin authorship a little clunky.

panicstevenson avatar Sep 24 '22 19:09 panicstevenson

too lazy to send a PR for this

diff --git a/webpack/webpack.config.ts b/webpack/webpack.config.ts
index b28eecd02..32f952adf 100644
--- a/webpack/webpack.config.ts
+++ b/webpack/webpack.config.ts
@@ -112,6 +112,7 @@ export default (
         path.join(__dirname, '../dist/resources/sounds'),
         path.join(__dirname, '../dist/ui/raidboss/skins/'),
       ],
+      watchFiles: ['./ui/raidboss/skins'],
       devMiddleware: {
         writeToDisk: true,
       },

trim21 avatar Sep 25 '22 06:09 trim21

This is not quite enough. From what I can tell, the dev server sees that the files have changed and rebuilds, but doesn't end up reloading the overlays to use them because it doesn't know about any dependency there.

quisquous avatar Sep 30 '22 21:09 quisquous

Also, I think it should be:

diff --git a/webpack/webpack.config.ts b/webpack/webpack.config.ts
index 9556dfc81..8cdcc22ae 100644
--- a/webpack/webpack.config.ts
+++ b/webpack/webpack.config.ts
@@ -112,6 +112,9 @@ export default (
         path.join(__dirname, '../dist/resources/sounds'),
         path.join(__dirname, '../dist/ui/raidboss/skins/'),
       ],
+      watchFiles: [
+        './ui/**/skins/',
+      ],
       devMiddleware: {
         writeToDisk: true,
       },

quisquous avatar Sep 30 '22 21:09 quisquous