-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
💪 phase/solvedPost is donePost is done🗄 area/interfaceThis affects the public interfaceThis affects the public interface🧑 semver/majorThis is a changeThis is a change
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Problem
I think the development option offers useful features, but I don’t think it’s good for a library to output different content based on an environment variable. I do think it’s useful for an integration to leverage a mode to determine what the output looks like.
- Webpack has
mode. (This is already used) - Vite has
mode. - Node.js has conditions.
- Rollup has no such option as far as I’m aware.
- ESBuild has no such option as far as I’m aware.
Especially when it comes to MDX on demand I believe it’s good to be explicit about this, because it determines whether the user should use /jsx-runtime or /jsx-dev-runtime.
Solution
- Default
developmentto false, notprocess.env.NODE_ENV === 'development' @mdx-js/rollup: Support Viteenv.mode@mdx-js/node-loader: Use thedevelopmentexports condition inpackage.jsonto enable development mode.@mdx-js/register: Use thedevelopmentexports condition inpackage.jsonto enable development mode.
This means Rollup, esbuild, and direct users of @mdx-js/mdx need to specify development: true explicitly.
Alternatives
Keep it as-is. 🤷
Metadata
Metadata
Assignees
Labels
💪 phase/solvedPost is donePost is done🗄 area/interfaceThis affects the public interfaceThis affects the public interface🧑 semver/majorThis is a changeThis is a change