Skip to content

feat: provide static process.* and import.meta.* build flags#1331

Merged
pi0 merged 8 commits intomainfrom
feat/process-dev
Jun 21, 2023
Merged

feat: provide static process.* and import.meta.* build flags#1331
pi0 merged 8 commits intomainfrom
feat/process-dev

Conversation

@pi0
Copy link
Copy Markdown
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