CS Fundamentals Trainer · JavaScript · Security
A Vite app reads import.meta.env.VITE_PAYMENT_SECRET in a component. After vite build, where does the secret's value end up?
A Vite app reads `import.meta.env.VITE_PAYMENT_SECRET` in a component. After `vite build`, where does the secret's value end up?
- In a server-side env file that the browser fetches with the user's session
- Inlined as a plain string in the JavaScript files served to every visitor
- Encrypted in the bundle and decrypted at runtime with a key from the build
- Nowhere, because Vite strips variables whose names contain `SECRET`
Difficulty: easy