You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/config/README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,12 +162,16 @@ module.exports = {
162
162
163
163
Setting this to `false` can speed up production builds if you don't need source maps for production.
164
164
165
-
### corsUseCredentials
165
+
### crossorigin
166
166
167
-
- Type: `boolean`
168
-
- Default: `false`
167
+
- Type: `string`
168
+
- Default: `undefined`
169
+
170
+
Configure the `crossorigin` attribute on `<link rel="stylesheet">` and `<script>` tags in generated HTML.
171
+
172
+
Note that this only affects tags injected by `html-webpack-plugin` - tags directly added in the source template (`public/index.html`) are not affected.
169
173
170
-
In modern mode, the generated HTML will include `<script type="module">`, which is [loaded with CORS always enabled](https://jakearchibald.com/2017/es-modules-in-browsers/#always-cors). By default, it is treated as `crossorigin="anonymous"`, setting this option to `true` will use `crossorigin="use-credentials"` instead.
174
+
See also: [CROS setting attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes)
Copy file name to clipboardExpand all lines: docs/guide/browser-compatibility.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ The cool part though is that there are no special deployment requirements. The g
63
63
For a Hello World app, the modern bundle is already 16%smaller. In production, the modern bundle will typically result in significantly faster parsing and evaluation, improving your app's loading performance.
64
64
65
65
::: tip
66
-
`<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.
66
+
`<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, set the [crossorigin](../config/#crossorigin) option to `use-credentials`.
67
67
68
68
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:
0 commit comments