Skip to content

[Bug]: html-minifier-terser stuck on empty file #193

Description

What happened?

If you run html-minifier-terser on an empty file it hangs. I realize that empty input files is not a normal situation but I don't think it should hang there, just produce an empty outfile.

To reproduce

This will hang forever

$ touch some-file.html 
$ html-minifier-terser some-file.html -o /dev/stdout

Caution

Make sure you don't already have content in the test file from testing the working case.

This will work

$ echo hello > some-file.html
$ html-minifier-terser some-file.html -o /dev/stdout

Regards
Mikael Lövqvist

Version

v7.2.0

What browsers are you seeing the problem on?

No response

Link to reproduce

No response

Relevant log output

Willing to submit a PR?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions