Skip to content

Conversation

SaqibAltaf
Copy link

Package installed
yarn add -D @julr/vite-plugin-validate-env

Modified files
apps/react-vite -> vite.config.ts
vite.config.ts

this is added in vite.config.ts
ValidateEnv({
VITE_APP_API_URL: Schema.string(),
VITE_APP_ENABLE_API_MOCKING: Schema.boolean(),
}),

it will validate env during build

Copy link

netlify bot commented Sep 26, 2024

Deploy Preview for bulletproof-react-app ready!

Name Link
🔨 Latest commit 4c52388
🔍 Latest deploy log https://app.netlify.com/sites/bulletproof-react-app/deploys/66f56613ecd4e00009cf43f9
😎 Deploy Preview https://deploy-preview-214--bulletproof-react-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@SaqibAltaf
Copy link
Author

Package installed yarn add -D @julr/vite-plugin-validate-env

Modified files apps/react-vite -> vite.config.ts vite.config.ts

this is added in vite.config.ts ValidateEnv({ VITE_APP_API_URL: Schema.string(), VITE_APP_ENABLE_API_MOCKING: Schema.boolean(), }),

yarn add -D @julr/vite-plugin-validate-env

plugins: [
react(),
viteTsconfigPaths(),
ValidateEnv({
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for making this PR. I think we can pass Zod schema here from src/config/env, to make it consistent...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants