Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(schema,vite): allow $client and $server vite env overrides #22302

Merged
merged 1 commit into from Jul 24, 2023

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

#13499 (comment)

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This allows configuring client/server configuration for vite directly in the Nuxt config, without needing to do so in a hook. This is pure convenience, but avoids issues where setting a vite configuration for the client ends up having negative implications for the server configuration, as in the linked issue above.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@stackblitz
Copy link

stackblitz bot commented Jul 24, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@danielroe danielroe requested review from pi0 and antfu July 24, 2023 14:06
@pi0
Copy link
Member

pi0 commented Jul 24, 2023

This is a nice idea for env (client/server) specific configuration. However, I'm a little bit concerned about making it "vite" specific. It could be extended to other bundlers (webpack) but also possibly for edge cases such as app config which is client/server specific. I think we can move forward with this and always alias only to mention about possibility of a (more generic) feature.

@danielroe
Copy link
Member Author

danielroe commented Jul 24, 2023

Yes, I think we should support webpack out of the box (will implement in a parallel PR) πŸ‘

@danielroe danielroe changed the title feat(schema): allow $client and $server vite env overrides feat(schema,vite): allow $client and $server vite env overrides Jul 24, 2023
@danielroe
Copy link
Member Author

@pi0 Any changes you would suggest? I don't think there's anything blocking us from refactoring to a native c12 feature if we end up building it.

@danielroe danielroe merged commit e2a6ad3 into main Jul 24, 2023
30 checks passed
@danielroe danielroe deleted the feat/vite-client-env branch July 24, 2023 17:32
@github-actions github-actions bot mentioned this pull request Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants