shelley/ui: copy assets (manifest.json, icons) during build

Philip Zeyliger created

Prompt: I see errors fetching manifest.json when i load up shelley in the chrome inspector

The build script was not copying files from src/assets/ to dist/,
causing manifest.json and icons to return 404 errors in Chrome.
This was visible as errors in Chrome DevTools console.

Change summary

ui/scripts/build.js | 8 ++++++++
1 file changed, 8 insertions(+)

Detailed changes

ui/scripts/build.js 🔗

@@ -55,6 +55,14 @@ async function build() {
     fs.copyFileSync('src/index.html', 'dist/index.html');
     fs.copyFileSync('src/styles.css', 'dist/styles.css');
 
+    // Copy assets (icons, manifest, etc.)
+    const assetsDir = 'src/assets';
+    if (fs.existsSync(assetsDir)) {
+      for (const file of fs.readdirSync(assetsDir)) {
+        fs.copyFileSync(`${assetsDir}/${file}`, `dist/${file}`);
+      }
+    }
+
     // Write build info
     // Get the absolute path to the src directory for staleness checking
     const srcDir = new URL('../src', import.meta.url).pathname;