fix: disable server bundle minification for readable error stack traces#5162
Open
JorgeEscire wants to merge 1 commit intoDSpace:mainfrom
Open
fix: disable server bundle minification for readable error stack traces#5162JorgeEscire wants to merge 1 commit intoDSpace:mainfrom
JorgeEscire wants to merge 1 commit intoDSpace:mainfrom
Conversation
The production server bundle (dist/server/main.js) was minified, causing Node.js to print the entire file in stack traces when uncaught exceptions occurred. Since this bundle only runs on the server and is never sent to browsers, minification provides no benefit. Tree-shaking and other production optimizations remain active via mode: 'production'.
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.
References
Description
Disable minification for the server-side webpack bundle to produce readable error stack traces in production.
Instructions for Reviewers
List of changes in this PR:
optimization: { minimize: false }towebpack/webpack.prod.tsto disable minification ofdist/server/main.jsHow to test:
throw new Error('hello world')anywhere in the body ofserver.tsto simulate an uncaught erroryarn build:prodyarn serve:ssrNotes:
mode: 'production'is preserved, so tree-shaking and other production optimizations remain activewebpack.browser.ts) is unaffected and remains minifiedChecklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)