kentcdodds / mdx-bundler

🦤 Give me MDX/TSX strings and I'll give you back a component you can render. Supports imports!
MIT License
1.78k stars 75 forks source link

fix: add NODE_ENV to `define` only if it is set #206

Closed pkerschbaum closed 1 year ago

pkerschbaum commented 1 year ago

closes #205

What: #205

Why: esbuild >= 0.16.0 forces that something passed via define is a string. This was introduced in v0.16.0, see section "Add additional validation of API parameters" of https://github.com/evanw/esbuild/releases/tag/v0.16.0.

How: 'process.env.NODE_ENV' is only set in define from now on if it is not undefined.

Checklist: