Skip to content

fix: disable code minification#150

Merged
43081j merged 1 commit into
tinylibs:mainfrom
bluwy:no-minify
Jun 26, 2026
Merged

fix: disable code minification#150
43081j merged 1 commit into
tinylibs:mainfrom
bluwy:no-minify

Conversation

@bluwy

@bluwy bluwy commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

This doesn't change the dist code much, because the only minification it did before was renaming identifiers, but I think it's better to not minify at all.

One benefit of this is you get better error messages:

                if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new NonZeroExitError(this, result);
                                                                                                         ^

NonZeroExitError: The process exited with a non-zero status (128)
    at ExecProcess._waitForOutput (file:///Users/bjorn/Work/oss/tinyexec/dist/main.mjs:291:92)
    at async file:///Users/bjorn/Work/oss/tinyexec/test.mjs:3:1 {

Before:

                if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new k(this, i);
                                                                                                         ^

k [Error]: The process exited with a non-zero status (128)
    at I._waitForOutput (file:///Users/bjorn/Work/oss/tinyexec/dist/main.mjs:291:92)
    at async file:///Users/bjorn/Work/oss/tinyexec/test.mjs:3:1 {

Note the NonZeroExitError: part

@43081j

43081j commented Jun 26, 2026

Copy link
Copy Markdown
Member

what's the size difference?

note you can also retain those names by keepNames.

i'm not necessarily against this but want to understand these two things first.

@bluwy

bluwy commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Before: 8.86 kB. After: 11.69 kB.

With keepNames: 9.24 kB. Also fixes the error name issue.

But I also prefer we don't minify at all like how we usually recommend people to setup.

@43081j 43081j merged commit c84e823 into tinylibs:main Jun 26, 2026
9 checks passed
@bluwy bluwy deleted the no-minify branch June 26, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants