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: provide static process.* and import.meta.* build flags #1331

Merged
merged 8 commits into from
Jun 21, 2023

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jun 21, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 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)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Provide static flags. These are replaced at build time and can be used to tweak build output bundle based on them. (Therefore are typed as optional since externals won't have them)

  • process.dev / import.meta.dev: true for development mode otherwise false
  • process.client / import.meta.client: Always false
  • process.server / import.meta.server: Always true
  • process.nitro / import.meta.nitro: Always true
  • process.prerender / import.meta.prerender: When in prerender mode
  • process.preset / import.meta.preset: Nitro build preset
  • process.versions.nitro / import.meta.versions.nitro

πŸ“ Checklist

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

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.

1 participant