Skip to content


Browse files Browse the repository at this point in the history
docs(vite-legacy): Note about using regenerator-runtime in Content …
…Security Policy environment (#7234)

Co-authored-by: Bjorn Lu <>
  • Loading branch information
svilen-ivanov and bluwy committed Mar 10, 2022
1 parent 2351d79 commit 0fd6422
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/plugin-legacy/
Expand Up @@ -173,6 +173,8 @@ These values (without the `sha256-` prefix) can also be retrieved via
const { cspHashes } = require('@vitejs/plugin-legacy')

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]( 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.

## References

- [Vue CLI modern mode](
Expand Down

0 comments on commit 0fd6422

Please sign in to comment.