Skip to content

Commit a608074

Browse files
haoqunjiangyyx990803
authored andcommitted
docs: add documentation about the __VUE_PROD_TRUSTED_TYPES__ flag
1 parent e9f8419 commit a608074

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

packages/runtime-core/src/featureFlags.ts

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ export function initFeatureFlags() {
2525
getGlobalThis().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false
2626
}
2727

28+
if (typeof __FEATURE_PROD_TRUSTED_TYPES__ !== 'boolean') {
29+
__DEV__ && needWarn.push(`__VUE_PROD_TRUSTED_TYPES__`)
30+
getGlobalThis().__VUE_PROD_TRUSTED_TYPES__ = false
31+
}
32+
2833
if (__DEV__ && needWarn.length) {
2934
const multi = needWarn.length > 1
3035
console.warn(

packages/vue/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
- Default: `false`
5050
- Enable / disable detailed warnings for hydration mismatches in production
5151

52+
- `__VUE_PROD_TRUSTED_TYPES__`
53+
- Default: `false`
54+
- Enable / disable built-in Trusted Types Policy for compatibility with the [`trusted-types` CSP directive](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types)
55+
5256
The build will work without configuring these flags, however it is **strongly recommended** to properly configure them in order to get proper tree-shaking in the final bundle.
5357

5458
### For Server-Side Rendering

0 commit comments

Comments
 (0)