Skip to content

v0.1.2

Choose a tag to compare

@RingoTangs RingoTangs released this 19 Apr 12:08
· 265 commits to main since this release

Summary

This patch release adds a standard Docker-based static deployment flow for the React team template and refines staged-file formatting rules.

Changes

  • Add a multi-stage Dockerfile for building the Vite app with Node and serving the final dist/ output with Nginx.
  • Add root-level nginx.conf with SPA fallback support for TanStack Router and long-term cache headers for static assets.
  • Add .dockerignore to keep Docker build context small and avoid copying local dependencies, build outputs, environment files, and IDE metadata.
  • Document Docker build and run commands in both English and Chinese README files.
  • Refine lint-staged patterns by adding mts, cts, pcss, postcss, and svg support while keeping pre-commit checks lightweight.

Verification

  • pnpm check
  • pnpm build
  • docker build -t react-app:local .

Notes

  • This release does not introduce breaking changes.
  • The Docker image serves static assets only; it does not run a Node.js server at runtime.
  • VITE_* environment variables are injected at build time. Runtime environment switching should be implemented separately if needed.
  • No build artifacts or Docker images are attached to this release; use the GitHub-generated source archives for template download.

概要

本次补丁版本为 React 团队模板新增标准 Docker 静态部署流程,并优化 staged file 格式化规则。

更新内容

  • 新增多阶段 Dockerfile,使用 Node 构建 Vite 应用,并通过 Nginx 托管最终 dist/ 产物。
  • 新增根目录 nginx.conf,支持 TanStack Router 的 SPA fallback,并为静态资源配置长期缓存。
  • 新增 .dockerignore,减少 Docker build context,避免复制本地依赖、构建产物、环境变量和 IDE 元数据。
  • 在英文 README 和中文 README 中补充 Docker 构建与运行命令。
  • 优化 lint-staged 匹配规则,补齐 mts、cts、pcss、postcss 和 svg,同时保持 pre-commit 检查轻量。

验证

  • pnpm check
  • pnpm build
  • docker build -t react-app:local .

说明

  • 本版本不包含破坏性变更。
  • Docker 镜像只托管静态资源,运行时不启动 Node.js 服务。
  • VITE_* 环境变量为构建期注入;如需运行时环境切换,应单独设计运行时配置机制。
  • 本次 Release 不额外挂载构建产物或 Docker 镜像,模板下载可直接使用 GitHub 自动生成的源码压缩包。