Skip to content

Commit

Permalink
fix(build): use crossorigin for nomodule (#8322)
Browse files Browse the repository at this point in the history
Co-authored-by: sapphi-red <green@sapphi.red>
  • Loading branch information
zuochenxue and sapphi-red authored Jun 1, 2022
1 parent b3d9652 commit 7f59989
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/plugin-legacy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
tag: 'script',
attrs: {
type: 'module',
crossorigin: true,
src: `${config.base}${modernPolyfillFilename}`
}
})
Expand Down Expand Up @@ -390,6 +391,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
tag: 'script',
attrs: {
nomodule: true,
crossorigin: true,
id: legacyPolyfillId,
src: `${config.base}${legacyPolyfillFilename}`
},
Expand All @@ -412,6 +414,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
tag: 'script',
attrs: {
nomodule: true,
crossorigin: true,
// we set the entry path on the element as an attribute so that the
// script content will stay consistent - which allows using a constant
// hash value for CSP.
Expand Down

0 comments on commit 7f59989

Please sign in to comment.