0

Is there any way/options to change Next.js output so that it avoid compressing html source?

Luca Reghellin
  • 7,426
  • 12
  • 73
  • 118
  • 1
    Adding `compress: false` to your next.config.js should turn off all compression — I don't see an option to turn it off per filetype, but if it's a temporary change that might work fine for you. – Zac Anger Jan 17 '21 at 18:24
  • Doesn't work: that's for gzip compression – Luca Reghellin Jan 17 '21 at 18:44
  • 1
    Oh, then by compression did you mean minification? I believe Next calls `ReactDOMServer.renderToStaticMarkup` under the hood, which doesn't have an option like that, so your best bet would be to run something like tidy or some other formatter afterwards. – Zac Anger Jan 17 '21 at 18:45
  • (Out of time to edit): I meant renderToString, not renderToStaticMarkup. – Zac Anger Jan 17 '21 at 18:50
  • @LucaReghellin Would this solution work: https://stackoverflow.com/a/45297699/1870780? – juliomalves Jan 18 '21 at 11:25
  • @Julio thnk you, it probably would do the trick but I hoped in something less involved. It's not a realy important issue to me, it was just for better testing, but I can do test in other ways. Thank you – Luca Reghellin Jan 18 '21 at 12:14

0 Answers0