diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 4c97971ea..f16d215b5 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -77,6 +77,18 @@ function injectBasePathPlugin() { }; } +// Cloudflare Rocket Loader rewrites script tags and runs bundles through its +// own loader, breaking ES-module semantics; data-cfasync="false" opts out. +function rocketLoaderOptOutPlugin() { + return { + name: 'xui-rocket-loader-opt-out', + apply: 'build', + transformIndexHtml(html) { + return html.replaceAll('