- Create a new angular project:
ng new
- Add nonce to app-root as explained here: https://angular.io/guide/security#content-security-policy
We use a dummy value for nonce just for testing, for example:
<!-- src/index.html -->
<app-root ngCspNonce="123"></app-root>
- Add a stylesheet link to head, for example:
<!-- src/index.html -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" />
- Build and see error message
npm run build
# Index html generation failed.
# link.prev?.setAttribute is not a function