-
Notifications
You must be signed in to change notification settings - Fork 360
Add field to package.json to output an unminified build #1097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
⚠️ No Changeset found
Latest commit: bf19e48
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
76d0086 to
54e48b4
Compare
0a134ab to
74fdad6
Compare
54e48b4 to
1e51a12
Compare
rschristian
commented
Oct 24, 2025
I'm often wanting to step through the source of Preact or Signals, but doing this is difficult since we ship minified code.
Not sure on your specific intent here, but a while back I toyed with doing just this with Preact and found it absurdly easy to break apps by pulling in two copies at once. Ensuring the entire module graph resolves just to the debug build is just as tricky as trying to avoid the dual package hazard and users aren't going to understand the intricacies.
I'm not against adding this, it may be useful for Microbundle users, but I don't think we can ship it with Preact stuff in particular. Way too easy for folks to break their apps and get the (incredibly opaque) __H errors.
1e51a12 to
8b91262
Compare
|
Size Change: 0 B Total Size: 65.9 kB i️ View Unchanged
|
8b91262 to
bf19e48
Compare
I'm often wanting to step through the source of Preact or Signals, but doing this is difficult since we ship minified code. In this PR I add an option to microbundle to output a "debug" build. This debug build is just an unminified ESM bundle of the library.
Consumers of microbundle libraries can then setup an alias in their bundle to use this build output when they want to step through sources of libraries of microbundle libraries.
NOTE: This format DOES NOT support React-style development vs production builds. This format only produces an unminifed build of the same source that is minified in other builds. However it should only be used for development. We have tuned the minification options to produce better than average minification and so those minified builds should be used in production bundles.