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

demo site fails with Minify CSS enabled #110

Closed AndrJ closed 2 years ago

AndrJ commented 2 years ago

Hi Thanks for developing this!

When I enable Minify CSS, I get the following error on the demo site: ReferenceError: process is not defined

https://terser.org/html-minifier-terser/

<!doctype html>
<html>
<head>
  <style>
    p {
      color: red;
    }
  </style>
</head>
<body>
  <p>This is my paragraph.</p>
</body>
</html>
DanielRuf commented 2 years ago

grafik

@sibiraj-s I guess this is related to some check that should not happen on browsers (process.env?). Maybe we have to check first if process is defined (typeof process !== 'undefined' or process &&).

sibiraj-s commented 2 years ago

Yeah. Will fix that. We'll need to polyfill for node while building for web.

DanielRuf commented 2 years ago

Perfect, works again now =)

grafik

AndrJ commented 2 years ago

Thank you! it is perfect!:blush: