Skip to content

chore: optimize build config and dependency management#1

Open
llootupsl wants to merge 2 commits into
mainfrom
trae/solo-agent-ke37Qr
Open

chore: optimize build config and dependency management#1
llootupsl wants to merge 2 commits into
mainfrom
trae/solo-agent-ke37Qr

Conversation

@llootupsl
Copy link
Copy Markdown
Owner

🎯 Changes

1. 依赖管理优化

  • 调整了 package-lock.json 中多个依赖包的 peer 属性,以更好地管理依赖关系。
  • 移除了不再需要的 node-gyp-build 依赖,精简了项目。
  • 将 Vite 版本从 6.4.1 升级到 6.4.2,以获取最新功能和修复。

2. TypeScript 配置规范化

  • 移除了 tsconfig.json 中的 baseUrl 配置,使路径解析更清晰。
  • 为所有路径别名添加了 ./ 前缀,确保路径引用的一致性和准确性。
  • 更新了相关注释,提高了配置的可读性。

3. Vite 构建配置增强

  • 新增了 vite-plugin-compression 插件,配置了 gzipbrotli 压缩,以减小构建产物大小。
  • 配置了 terser 压缩选项,移除了生产环境中的控制台输出和调试信息。
  • 禁用了 sourcemap,进一步减小了构建体积。
  • 配置了构建报告和 chunk 大小警告,便于性能监控和优化。
  • 优化了输出文件名格式,使其包含哈希值,以支持更好的缓存策略。

💡 Technical Highlights

  • 构建性能提升: 通过引入 gzipbrotli 压缩,显著减小了最终构建产物的大小,提升了加载速度。
  • 代码精简: terser 配置移除了不必要的代码,进一步优化了生产环境的性能。
  • 缓存优化: 输出文件名中包含哈希值,有助于浏览器更好地缓存静态资源,提高二次访问速度。
  • 配置规范化: TypeScript 路径别名的统一前缀和 baseUrl 的移除,使得项目配置更加规范和易于维护。

Co-authored-by: traeagent <traeagent@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
project-br3t3 Canceled Canceled Apr 8, 2026 8:28pm

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 427ccede4a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vite.config.js
target: "esnext",
outDir: "release-dist",
emptyOutDir: true,
minify: 'terser',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Declare terser explicitly when enabling terser minification

Switching build.minify to "terser" makes release builds depend on the terser package, but this repo still only gets it via Vite’s optional peer resolution (it is not declared in root devDependencies). In environments that skip optional peers (for example npm ci --omit=optional) or use stricter peer handling, vite build will fail at runtime with a missing terser error. Please add terser as an explicit dev dependency to make builds deterministic.

Useful? React with 👍 / 👎.

Co-authored-by: traeagent <traeagent@users.noreply.github.com>
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.

1 participant