Disable useless webpack minification in dev mode#213
Open
Conversation
The optimization.minimize was hardcoded to true, causing TerserPlugin to run even in dev builds. This slows down development builds for no benefit. Now minification only runs when NODE_ENV=production. Co-Authored-By: Claude <noreply@anthropic.com> https://claude.ai/code/session_01QzPz5qNFAMFaYo8YDkkFU8
The API webpack config now conditionally minifies based on NODE_ENV. Without this, CI builds would produce unminified output since NODE_ENV was not explicitly set (unlike the frontend build which already had it). Co-Authored-By: Claude <noreply@anthropic.com> https://claude.ai/code/session_01QzPz5qNFAMFaYo8YDkkFU8
Contributor
Greptile SummaryThis PR disables TerserPlugin minification during development builds by making
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[webpack build starts] --> B{NODE_ENV === 'production'?}
B -->|Yes - CI / production| C[minimize: true]
B -->|No - local dev| D[minimize: false]
C --> E[TerserPlugin runs]
E --> F[Minified main.js]
D --> G[Skip TerserPlugin]
G --> H[Unminified main.js]
style C fill:#22c55e,color:#fff
style D fill:#3b82f6,color:#fff
style F fill:#22c55e,color:#fff
style H fill:#3b82f6,color:#fff
Last reviewed commit: a64ae9b |
|
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.



Summary
Disable dev minification: Changed minimize: true (hardcoded) to minimize: process.env['NODE_ENV'] === 'production' in apps/api/webpack.config.js, so TerserPlugin no longer runs during development builds
Ensure production builds still minify: Added NODE_ENV: production to the API build step in .github/workflows/build.yml (the frontend already had this; the MCP server doesn't need it since esbuild defaults to production config)