Skip to content

Commit

Permalink
fix(ui): remove crossorigin attributes for same origin assets (#6883)
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa authored Nov 8, 2024
1 parent 3c56feb commit 6e793c6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ export const config: UserConfig = {
// return html.replace('<!-- !LOAD_METADATA! -->', `<script>window.METADATA_PATH="${debugLink}/html.meta.json.gz"</script>`)
// },
// },
{
// 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',
Expand Down

0 comments on commit 6e793c6

Please sign in to comment.