Skip to content

Commit 0fd6422

Browse files
svilen-ivanovbluwy
andauthored
docs(vite-legacy): Note about using regenerator-runtime in Content Security Policy environment (#7234)
Co-authored-by: Bjorn Lu <[email protected]>
1 parent 2351d79 commit 0fd6422

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/plugin-legacy/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ These values (without the `sha256-` prefix) can also be retrieved via
173173
const { cspHashes } = require('@vitejs/plugin-legacy')
174174
```
175175

176+
When using the `regenerator-runtime` polyfill, it will attempt to use the `globalThis` object to register itself. If `globalThis` is not available (it is [fairly new](https://caniuse.com/?search=globalThis) and not widely supported, including IE 11), it attempts to perform dynamic `Function(...)` call which violates the CSP. To avoid dynamic `eval` in the absence of `globalThis` consider adding `core-js/proposals/global-this` to `additionalLegacyPolyfills` to define it.
177+
176178
## References
177179

178180
- [Vue CLI modern mode](https://cli.vuejs.org/guide/browser-compatibility.html#modern-mode)

0 commit comments

Comments
 (0)