MPA
This plugin currently does not support Multi Page Applications (MPAs) and this is unlikely to change due to the nature of how MPAs interact with Vite.
Examples of MPA frameworks include Nuxt.js, Remix, etc.
Since MPAs typically have access to a server, you should use a nonce-based CSP. We recommend checking if your MPA framework has built-in nonce support or solutions tailored to MPAs. If not, you can create a custom solution by following these rules:
Rules to Follow
On every page request:
- Generate a new nonce (opens in a new tab).
- Add the nonce to the CSP header or meta (opens in a new tab).
- Add the nonce to the script/style tags.
Individual frameworks like Remix and Nuxt may be coming out with their own solutions soon, as Vite recently added support for nonces. (opens in a new tab)