diff --git a/vite.config.js b/vite.config.js index 55ebf977f..7d778d8f3 100644 --- a/vite.config.js +++ b/vite.config.js @@ -13,9 +13,19 @@ import buildConfig from './build.config'; const copyFiles = { targets: [ { + // Element Call's dist must land flat in public/element-call/ so the call + // widget URL (/public/element-call/index.html) resolves. v4.x of + // vite-plugin-static-copy preserves the full source path under dest, so + // we strip the 4 leading segments of the source base + // (node_modules/@element-hq/element-call-embedded/dist) — mirroring the + // stripBase pattern used by the android/locales targets below. The old + // `rename: 'element-call'` form silently produced + // public/node_modules/.../dist/ under v4.x, 404ing the widget (calls + // broke on cinny-desktop; web only worked because its deployed copy was + // a stale artifact from before the vite-plugin-static-copy v4 bump). src: 'node_modules/@element-hq/element-call-embedded/dist', - dest: 'public', - rename: 'element-call', + dest: 'public/element-call', + rename: { stripBase: 4 }, }, { src: 'config.json',