philhawksworth / netlify-plugin-minify-html

26 stars 8 forks source link

Await comp; make onSuccess async function #4

Closed oliverroick closed 4 years ago

oliverroick commented 4 years ago

Hi @philhawksworth,

I experienced the same issues as described in #2. It looks like comp returns a Promise and the node process running the onSuccess terminates before the Promise is resolved. As a result only some but not all files are minified.

Proposing a solution here that waits for the Promise to be resolved, i.e. until all files are minified.


NOTE: I verified the behaviour described above by making a local copy of netlify-plugin-minify-html and adding it to netlify.toml.

If I install netlify-plugin-minify-html from the plugin registry, it looks like ~no HTML files are minified at all~ only the 404.html on my site , so this might not fully resolve issue #2.