chore: optimize build config and dependency management#1
Conversation
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 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".
| target: "esnext", | ||
| outDir: "release-dist", | ||
| emptyOutDir: true, | ||
| minify: 'terser', |
There was a problem hiding this comment.
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>
🎯 Changes
1. 依赖管理优化
package-lock.json中多个依赖包的peer属性,以更好地管理依赖关系。node-gyp-build依赖,精简了项目。6.4.1升级到6.4.2,以获取最新功能和修复。2. TypeScript 配置规范化
tsconfig.json中的baseUrl配置,使路径解析更清晰。./前缀,确保路径引用的一致性和准确性。3. Vite 构建配置增强
vite-plugin-compression插件,配置了gzip和brotli压缩,以减小构建产物大小。terser压缩选项,移除了生产环境中的控制台输出和调试信息。sourcemap,进一步减小了构建体积。chunk大小警告,便于性能监控和优化。💡 Technical Highlights
gzip和brotli压缩,显著减小了最终构建产物的大小,提升了加载速度。terser配置移除了不必要的代码,进一步优化了生产环境的性能。baseUrl的移除,使得项目配置更加规范和易于维护。