Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: sync Vite Modes with NODE_ENV #944

Merged
merged 1 commit into from
Sep 25, 2024
Merged

chore: sync Vite Modes with NODE_ENV #944

merged 1 commit into from
Sep 25, 2024

Conversation

aofei
Copy link
Member

@aofei aofei commented Sep 25, 2024

  • Updated the build script in package.json to set --mode in the vite build command to always match NODE_ENV (defaults to production).
  • Simplified .env to serve primarily as documentation and to provide essential default values.
  • Renamed .env.dev and .env.prod to .env.development and .env.production as Vite doesn't recognize the former.
  • Added .env.staging for easier deployment configuration.
  • Symlinked .env.development to .env.staging for quicker development environment setup.
  • Renamed VERCEL_PROXIED_API_BASE_URL to VITE_VERCEL_PROXIED_API_BASE_URL for consistency with other variables.
  • Added support for configuring NODE_ENV build argument in Dockerfile.
  • Renamed .github/workflows/build.yml to .github/workflows/publish-docker-image.yml, simplified the script, and set the Docker build argument NODE_ENV=staging.

Fixes #929


In Go+ Builder, we currently use only three environments:

  1. development: Used solely for local development. For convenience, we often configure it similarly to the staging environment.
  2. staging: A unified environment for everything that isn't development or production, merging traditional testing, qa, and staging.
  3. production: Reserved strictly for the live production system.

spx-gui/.env.production Outdated Show resolved Hide resolved
- Updated the `build` script in `package.json` to set `--mode` in the
  `vite build` command to always match `NODE_ENV` (defaults to
  `production`).
- Simplified `.env` to serve primarily as documentation and to provide
  essential default values.
- Renamed `.env.dev` and `.env.prod` to `.env.development` and
  `.env.production` as Vite doesn't recognize the former.
- Added `.env.staging` for easier deployment configuration.
- Symlinked `.env.development` to `.env.staging` for quicker development
  environment setup.
- Renamed `VERCEL_PROXIED_API_BASE_URL` to
  `VITE_VERCEL_PROXIED_API_BASE_URL` for consistency with other
  variables.
- Added support for configuring `NODE_ENV` build argument in
  `Dockerfile`.
- Renamed `.github/workflows/build.yml` to
  `.github/workflows/publish-docker-image.yml`, simplified the script,
  and set the Docker build argument `NODE_ENV=staging`.

Fixes goplus#929

Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
@qiniu-ci
Copy link

The PR environment is ready, please check the PR environment

[Attention]: This environment will be automatically cleaned up after a certain period of time., please make sure to test it in time. If you have any questions, please contact the builder team.

@aofei aofei merged commit 37c6a4d into goplus:dev Sep 25, 2024
5 checks passed
@aofei aofei deleted the NODE_ENV branch September 25, 2024 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Figure out the correct usage of NODE_ENV and modes for Vite
3 participants