Skip to content

Commit 14e731e

Browse files
authored
docs: add security warning (#615)
1 parent fd577b7 commit 14e731e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ module.exports = {
7070
};
7171
```
7272

73+
## Security Warning
74+
75+
This loader is primarily meant for development. The default settings are not safe for production environments. See the [recommended example configuration](#recommended) and the section on [nonces](#nonce) for details.
76+
7377
## Options
7478

7579
- [**`injectType`**](#injecttype)
@@ -964,6 +968,8 @@ module.exports = {
964968

965969
### Nonce
966970

971+
If you are using a [Content Security Policy](https://www.w3.org/TR/CSP3/) (CSP), the injected code will usually be blocked. A workaround is to use a nonce. Note, however, that using a nonce significantly reduces the protection provided by the CSP. You can read more about the security impact in [the specification](https://www.w3.org/TR/CSP3/#security-considerations). The better solution is not to use this loader in production.
972+
967973
There are two ways to work with `nonce`:
968974

969975
- using the `attributes` option

0 commit comments

Comments
 (0)