Conversation
- Gate MillionLint and vite-plugin-eslint behind `command === 'serve'`. They were running in `vite build`, adding ~10s of build time and shipping profiler instrumentation to the client. Million is now a dynamic import so a production build never needs the (dev-only) package. - Move @million/lint to devDependencies. - manualChunks: split node_modules into a stable `vendor` chunk so an app-only change between deploys keeps the large, rarely-changing vendor bundle cached in browsers and at the CDN edge. Local build time drops from ~20s to ~10s.
There was a problem hiding this comment.
🟢 Approval recommended
The changes are scoped to build tooling/configuration and appear internally consistent (dev-only gating + dependency move + chunking) without introducing breaking behavior for vite build.
Pull request overview
This PR updates the client’s Vite configuration to ensure development-only tooling (Million Lint + Vite ESLint plugin) does not run during production builds, and improves client-side caching by splitting third-party dependencies into a dedicated vendor chunk.
Changes:
- Make
vite.config.jsconditional oncommand, dynamically importing@million/lintand enablingvite-plugin-eslintonly forvite serve. - Configure Rollup
manualChunksto bundle allnode_modulescode into a singlevendorchunk. - Move
@million/lintfromdependenciestodevDependencies.
File summaries
| File | Description |
|---|---|
| client/vite.config.js | Gates dev-only plugins behind command === 'serve' and adds a vendor manual chunk for better caching. |
| client/package.json | Moves @million/lint to devDependencies to reflect dev-only usage. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
What
MillionLintandvite-plugin-eslintto dev only (command === 'serve'). They were in thepluginsarray unconditionally, sovite buildran the Million Lint transform + a full ESLint pass and shipped profiler instrumentation in the production bundle. Million is now loaded via a dynamicimport()inside the dev-only branch, so a production build never needs the package.@million/linttodevDependencies.build.rollupOptions.output.manualChunks: put everything fromnode_modulesinto a singlevendorchunk. The client previously shipped as one ~585 kB (175 kB gzip) file, so any app-code change invalidated the whole bundle for returning visitors. The ~300 kB (96 kB gzip) vendor chunk now keeps a stable hash across app-only changes.Why
Testing
npm run buildsucceeds;node --checkpasses on both output bundlesnpm run lintcleannpm run start(dev) still loads Million Lint + the eslint overlay