esm.sh icon indicating copy to clipboard operation
esm.sh copied to clipboard

🙏🏻(feature request) add minify control as URL flag

Open rivy opened this issue 9 months ago • 1 comments

I'd like to be able to control minification of the downloaded modules, specifically turning it off, as a URL flag/option. This would allow much easier reading/debugging of the downloaded modules, allowing local patches, when necessary. Only on/off would be fine, although more specific control would be great.

I've read through the documentation and I don't see any way to do this except running a local server with the MINIFY configuration set to false.

ref: esbuild ~ minify ref: esm.sh ~ Self-Hosting

The feature might look something like...

https://esm.sh/[email protected] # usual minified build (the default)
https://esm.sh/[email protected]?minify=on # continue to use `--minify` for the build command (equivalent to the default; optional)
https://esm.sh/[email protected]?minify=off # suppresses `--minify`
# might be useful...
https://esm.sh/[email protected]?minify=whitespace,identifiers,syntax # (maybe?) add specific `--minify-X` options to the build command

I think it would be helpful to be able to actually read the module code when trying to debug problems.

Thanks for the consideration.

rivy avatar Mar 16 '25 14:03 rivy

I would love this feature too

remorses avatar Jun 04 '25 11:06 remorses