You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Really appreciating the simplicity (and docs!) of esbuild. I think we have an initial use case like many people - just replacing our minification step with esbuild.
It seems that esbuild uses a different set of characters for the mangling process when there is an inline sourcemap present on otherwise-identical JS files. From my perspective, it would be ideal if the resulting minified files were the same.
Running a very simple esbuild minify (cat test-with-sourcemap.js.txt | yarn esbuild --minify, cat test-without-sourcemap.js.txt | yarn esbuild --minify) on these two files, identical but for the presence of a sourcemap, results in different output: test-with-sourcemap.js.txt test-without-sourcemap.js.txt
I haven't looked at the esbuild code myself, but am tempted to give it a shot.
The text was updated successfully, but these errors were encountered:
This is because of the character frequency analysis that is used to derive the order of minified names for better gzip compression. The idea is to prefer using the most-used characters in the non-symbol parts of the document (keywords, strings, etc.) over characters that are less-used or absent. This is a very slight win, and is only approximate based on the input text instead of the output text because otherwise it would require minifying twice. Skipping over comments is easy to fix.
Really appreciating the simplicity (and docs!) of esbuild. I think we have an initial use case like many people - just replacing our minification step with esbuild.
It seems that esbuild uses a different set of characters for the mangling process when there is an inline sourcemap present on otherwise-identical JS files. From my perspective, it would be ideal if the resulting minified files were the same.
Running a very simple esbuild minify (
cat test-with-sourcemap.js.txt | yarn esbuild --minify
,cat test-without-sourcemap.js.txt | yarn esbuild --minify
) on these two files, identical but for the presence of a sourcemap, results in different output:test-with-sourcemap.js.txt
test-without-sourcemap.js.txt
I haven't looked at the esbuild code myself, but am tempted to give it a shot.
The text was updated successfully, but these errors were encountered: