Split app env ownership#3303
Merged
Merged
Conversation
8f6ce94 to
5329ed7
Compare
nighca
commented
Jul 1, 2026
| file: ${{ matrix.dockerfile }} | ||
| build-args: | | ||
| NODE_ENV=staging | ||
| VITE_MODE=staging |
Collaborator
Author
There was a problem hiding this comment.
对于 staging/production/production-cn,构建时实际的 NODE_ENV 值都是 production(通过 npm script build 控制),之前外部指定 NODE_ENV 为 staging/production/production-cn 的做法是容易造成误解的
这里换成 VITE_MODE,明确是用于控制 vite mode,对应于最终配置文件的选用
| - name: Build account frontend for mainland China deployment | ||
| working-directory: spx-gui | ||
| run: NODE_ENV=production.cn npm run build:account | ||
| run: VITE_MODE=production-cn npm run build:account |
Collaborator
Author
There was a problem hiding this comment.
.env 的加载本身有一定策略,比如当指定 mode: abc 的时候,.env.abc.local 会优先级高于 .env.abc(详见 .env Files);考虑到这里 . 用于分隔 mode name 和 local 这样的特殊标识,因此在 mode name 中把原来的 . 换成 -,减少把 .cn 误解为像 .local 这样的特殊标记的可能性
| declare module 'vue-router' { | ||
| interface RouteMeta { | ||
| /** Whether the route requires sign-in */ | ||
| requiresSignIn?: boolean |
Collaborator
Author
There was a problem hiding this comment.
这个机制干掉了,维护这个机制会比较麻烦,依赖这个机制的页面很少;目前只有 admin 页面依赖它,改为由 admin 页面自己去实现了
aofei
reviewed
Jul 2, 2026
2792e13 to
7c49943
Compare
aofei
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3299
Summary
VITE_MODEto select Vite build modes in workflows and Dockerfiles, keepingNODE_ENVreserved for the runtime environment.Deployment Notes
When this change is released, update the Vercel configuration for the xbuilder app:
NODE_ENVenvironment variable toVITE_MODEand set it toproduction-cnwhere needed..env.*files committed in this project.Checks