Webpack config.optimization.minimize = true
should be the default
#51888
nicolassanmar
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
-
@nicolassanmar One reason to avoid minifying server-side code is to preserve clear stack traces in the logs. I'm currently exploring options to improve this using source maps, but Datadog doesn’t support it for logs ingested from the server side. From what I’ve found, enabling source maps at runtime impacts performance. So, the simplest and cheapest solution might be to just avoid minifying the source code. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
I think we should minify our server code by default (on
next build
).Currently, the way to do this is to add a webpack config option, which is somewhat out of the way.
To add this, we are required to add:
Non-Goals
No response
Background
I think this is a reasonable default to both:
Sentry
as server side code was not minified.I would like to know on which scenarios people actually want their server code not to be minified. After considering the use-cases and the amount of people that prefer one thing over the other, we can figure out if this proposal makes more sense as a default or as a more direct config option.
Proposal
As stated, I think we should minimized code the default, and make it so that users can opt out of it using
webpack
config, as I think that case is less common.If that's not something we want to do, we could at least provide a simple config option on the top-level of the
module.exports
onnext.config.js
A way to implement this could be the following
I am willing to contribute if this proposal seems reasonable
Beta Was this translation helpful? Give feedback.
All reactions