diff --git a/deploy-ui.mjs b/deploy-ui.mjs index daa52e9..1e3fe9e 100644 --- a/deploy-ui.mjs +++ b/deploy-ui.mjs @@ -21,27 +21,30 @@ import process from 'process'; const cwd = process.cwd(); const uiDist = path.join(cwd, 'src/ui/dist/ui/browser'); const files = fs - .readdirSync(uiDist) + .readdirSync(uiDist, { recursive: true }) .filter(f => f.endsWith('.html') || f.endsWith('.js') || f.endsWith('.css')); for (const filename of files) { let newName = filename; const oldPath = path.join(uiDist, filename); + const dirName = path.dirname(filename); + + fs.mkdirSync(path.join('dist', dirName), { recursive: true }); if (path.extname(filename) === '.html') { newName = 'ui.html'; - const newPath = path.join(cwd, 'dist', newName); + const newPath = path.join(cwd, 'dist', dirName, newName); // Replace