Add field to package.json to output an unminified build - #1097
Add field to package.json to output an unminified build#1097andrewiggins wants to merge 4 commits into
Conversation
|
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) |
|
Size Change: 0 B Total Size: 65.9 kB ℹ️ View Unchanged
|
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.