mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-03-09 17:09:05 -05:00
docs: add a note about CSP for modern mode [ci skip]
This commit is contained in:
@@ -64,6 +64,12 @@ For a Hello World app, the modern bundle is already 16% smaller. In production,
|
||||
|
||||
::: tip
|
||||
`<script type="module">` is loaded [with CORS always enabled](https://jakearchibald.com/2017/es-modules-in-browsers/#always-cors). This means your server must return valid CORS headers such as `Access-Control-Allow-Origin: *`. If you want to fetch the scripts with credentials, use the [corsUseCredentials](../config/#corsusecredentials) option.
|
||||
|
||||
Also, modern mode uses an inline script to avoid Safari 10 loading both bundles, so if you are using a strict CSP, you will need to explicitly allow the inline script with:
|
||||
|
||||
```
|
||||
Content-Security-Policy: script-src 'self' 'sha256-4RS22DYeB7U14dra4KcQYxmwt5HkOInieXK1NUMBmQI='
|
||||
```
|
||||
:::
|
||||
|
||||
[autoprefixer]: https://github.com/postcss/autoprefixer
|
||||
|
||||
Reference in New Issue
Block a user