refactor: pass NODE_ENV for vite config in ui plugin bunlder kit (#7595)

#### What type of PR is this?

/area ui
/area plugin
/kind improvement
/milestone 2.21.x

#### What this PR does / why we need it:

Modify the vite configuration in ui-plugin-bunlder-kit to avoid passing the entire process.env to the build process.

#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/7582/head^2
Ryan Wang 2025-07-04 12:21:41 +08:00 committed by GitHub
parent 07737f9de0
commit 238e5a3a4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

@ -33,9 +33,7 @@ function createVitePresetsConfig(manifestPath: string) {
return {
mode: mode || "production",
plugins: [Vue()],
define: {
"process.env": process.env,
},
define: { "process.env.NODE_ENV": "'production'" },
build: {
outDir: isProduction ? DEFAULT_OUT_DIR_PROD : DEFAULT_OUT_DIR_DEV,
emptyOutDir: true,