-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Handling dev and build config.define inconsistency #12866
Comments
Hello @Eazymov. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
|
This bug seems to happen from 4.1.2 (build). (In dev, it happens from pre-2.2) |
Without this feature there will be no way to use env without prefix? |
If you add If you want |
Documentation is
Explain in Detail
Since dev and build implement
define
differently when i use this configI get
STRING: 123, STRINGIFIED_STRING: "123"
during development andSTRING: "123", STRINGIFIED_STRING: "\"123\""
during production.It is noted in the docs but how is it supposed to work with that? What should i do if both ways of defining a variable give me different results? Check for
mode
and pass different values todefine
? Or am i just misunderstanding something?Seems like
vite
should provide consistency by itselfYour Suggestion for Changes
Make consistent behavior between
dev
andbuild
or add examples to the docs on how to deal with inconsistencyReproduction
dev https://stackblitz.com/edit/vitejs-vite-ibspf5?file=src%2Fmain.js&terminal=dev
build preview https://stackblitz.com/edit/vitejs-vite-ibspf5?file=src%2Fmain.js&terminal=preview
Steps to reproduce
No response
The text was updated successfully, but these errors were encountered: