How to set configuration for different modes? #18149
-
https://cn.vitejs.dev/guide/env-and-mode It didn't explain this To make it work properly, I changed as following export default defineConfig(({ command, mode, isSsrBuild, isPreview }) => {
void command, mode, isSsrBuild, isPreview
const modes: {
[key: string]: UserConfig
} = {
mode1: {
....
}
}
return Object.assign(
{
...
},
modes[mode]
)
} |
Beta Was this translation helpful? Give feedback.
Answered by
sapphi-red
Sep 24, 2024
Replies: 1 comment 1 reply
-
It's written here: https://cn.vitejs.dev/config/#conditional-config |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
q962
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's written here: https://cn.vitejs.dev/config/#conditional-config