terser / html-minifier-terser

actively maintained fork of html-minifier - minify HTML, CSS and JS code using terser - supports ES6 code
https://terser.org/html-minifier-terser
MIT License
376 stars 30 forks source link

Allow async functions for minifyCSS #112

Closed chrisspiegl closed 2 years ago

chrisspiegl commented 2 years ago

I tried using the clean-css option to import / process remote @import statements ({ inline: ['remote'] }).

This option however only works when the clean-css function is called with a callback.

Example based on "How to process remote @imports correctly:

var source = '@import url(http://example.com/path/to/remote/styles);';
new CleanCSS({ inline: ['remote'] }).minify(source, function (error, output) {
  // output.styles
});

Since the html-minifier-terser currently does not support async minifyCSS this is not working.

Async minification for JS was implemented based on this Issue: https://github.com/terser/html-minifier-terser/issues/49

Maybe CSS is similar to achieve?

sibiraj-s commented 2 years ago

Fixed in v7.0.0-alpha.2