If I understand correctly, NODE_ENV should really only ever be production or development (same as unset), so this PR sets the default NODE_ENV to production for any other mode except development.
(An alternate solution would be to do what vite does and set this to the hardcoded string production. Either one would solve the problem, let me know which you'd prefer.)
Description
Add-on to #356 which fixed part of the problem, but building in alternate modes can still cause the issue. For example:
Will correctly run a vite bundle in
staging
mode, but because of the issue detailed in #356 will also setNODE_ENV
tostaging
, which makesvite-plugin-vue
think this is a development build and leak__file
paths.If I understand correctly,
NODE_ENV
should really only ever beproduction
ordevelopment
(same as unset), so this PR sets the defaultNODE_ENV
toproduction
for any othermode
exceptdevelopment
.(An alternate solution would be to do what vite does and set this to the hardcoded string
production
. Either one would solve the problem, let me know which you'd prefer.)Linked Issues
354 #349