Skip to content

Commit 7f59989

Browse files
fix(build): use crossorigin for nomodule (#8322)
Co-authored-by: sapphi-red <[email protected]>
1 parent b3d9652 commit 7f59989

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/plugin-legacy/src/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
360360
tag: 'script',
361361
attrs: {
362362
type: 'module',
363+
crossorigin: true,
363364
src: `${config.base}${modernPolyfillFilename}`
364365
}
365366
})
@@ -390,6 +391,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
390391
tag: 'script',
391392
attrs: {
392393
nomodule: true,
394+
crossorigin: true,
393395
id: legacyPolyfillId,
394396
src: `${config.base}${legacyPolyfillFilename}`
395397
},
@@ -412,6 +414,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
412414
tag: 'script',
413415
attrs: {
414416
nomodule: true,
417+
crossorigin: true,
415418
// we set the entry path on the element as an attribute so that the
416419
// script content will stay consistent - which allows using a constant
417420
// hash value for CSP.

0 commit comments

Comments
 (0)