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

Feature: ability to unset/change built-in defines #156

Closed
pc-erin opened this issue Oct 4, 2023 · 1 comment
Closed

Feature: ability to unset/change built-in defines #156

pc-erin opened this issue Oct 4, 2023 · 1 comment

Comments

@pc-erin
Copy link

pc-erin commented Oct 4, 2023

There's an issue with some libraries that, instead of using process.env.NODE_ENV they use globalThis.process.env.NODE_ENV, and, and the default define behavior (not sure if it's this plugin or SWC) results in code like globalThis."development" === "development".

See: graphql/graphql-js#3928

I've tried to override this behavior using vite's define config option, but it doesn't seem to work.

@ArnaudBarre
Copy link
Member

This is working at least when in source code in dev. Probably a mismatch from Vite at build time or optimize deps time. Please open an issue with a small repro on stackblitz on the Vite core repo

@ArnaudBarre ArnaudBarre closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2023
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

No branches or pull requests

2 participants