Skip to content

Commit 6e793c6

Browse files
authored
fix(ui): remove crossorigin attributes for same origin assets (#6883)
1 parent 3c56feb commit 6e793c6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/ui/vite.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ export const config: UserConfig = {
8080
// return html.replace('<!-- !LOAD_METADATA! -->', `<script>window.METADATA_PATH="${debugLink}/html.meta.json.gz"</script>`)
8181
// },
8282
// },
83+
{
84+
// workaround `crossorigin` issues on some browsers
85+
// https://github.com/vitejs/vite/issues/6648
86+
name: 'no-crossorigin-for-same-assets',
87+
apply: 'build',
88+
transformIndexHtml(html) {
89+
return html
90+
.replace('crossorigin src="./assets/', 'src="./assets/')
91+
.replace('crossorigin href="./assets/', 'href="./assets/')
92+
},
93+
},
8394
],
8495
build: {
8596
outDir: './dist/client',

0 commit comments

Comments
 (0)