diff --git a/packages/vite/src/node/plugins/html.ts b/packages/vite/src/node/plugins/html.ts index 1912143b70fdde..3cb5ac20bfd3f4 100644 --- a/packages/vite/src/node/plugins/html.ts +++ b/packages/vite/src/node/plugins/html.ts @@ -675,6 +675,12 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin { attrs: { ...(isAsync ? { async: true } : {}), type: 'module', + // crossorigin must be set not only for serving assets in a different origin + // but also to make it possible to preload the script using ``. + // `