From 6e793c64a1952bee8948dee908b7f7d5ae857f5d Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Fri, 8 Nov 2024 18:01:07 +0900 Subject: [PATCH] fix(ui): remove crossorigin attributes for same origin assets (#6883) --- packages/ui/vite.config.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/ui/vite.config.ts b/packages/ui/vite.config.ts index 3b57c9d061ff..5dbaec0c72be 100644 --- a/packages/ui/vite.config.ts +++ b/packages/ui/vite.config.ts @@ -80,6 +80,17 @@ export const config: UserConfig = { // return html.replace('', ``) // }, // }, + { + // workaround `crossorigin` issues on some browsers + // https://github.com/vitejs/vite/issues/6648 + name: 'no-crossorigin-for-same-assets', + apply: 'build', + transformIndexHtml(html) { + return html + .replace('crossorigin src="./assets/', 'src="./assets/') + .replace('crossorigin href="./assets/', 'href="./assets/') + }, + }, ], build: { outDir: './dist/client',