Closed foxxyz closed 1 year ago
vite recently changed the signature for resolveConfig() to take a 4th argument defaultNodeEnv, which by default is set to development.
resolveConfig()
defaultNodeEnv
development
Since this argument is not added when resolveConfig is called in vite-ssg, it causes NODE_ENV to get set to development.
resolveConfig
NODE_ENV
n turn, this triggers vite-plugin-vue to consider this a development build, inserting absolute file paths into the bundle.
vite-plugin-vue
This PR adds the correct defaultNodeEnv so NODE_ENV is correctly set to production during a production build.
production
(Note: vite does the exact same when calling vite build)
vite build
@antfu thank you! And thank you for all the work you do for the Vue community! We appreciate it!
Description
vite recently changed the signature for
resolveConfig()
to take a 4th argumentdefaultNodeEnv
, which by default is set todevelopment
.Since this argument is not added when
resolveConfig
is called in vite-ssg, it causesNODE_ENV
to get set todevelopment
.n turn, this triggers
vite-plugin-vue
to consider this a development build, inserting absolute file paths into the bundle.This PR adds the correct
defaultNodeEnv
soNODE_ENV
is correctly set toproduction
during a production build.(Note: vite does the exact same when calling
vite build
)Linked Issues
354 #349