I'm having this problem which is mentioned here in the docs, but there's no explanation on _how_ to do that (building without minifying the HTML).
This is a setting on your production environment not Gatsby - the docs are saying to disable HTML minification on your CDN or web server you have deployed the site to.
For example, if you use Cloudflare you should disable HTML under Speed -> Auto Minify as it'll strip out HTML comments as part of the minification and break React.
@dbrookes THANK YOU! That totally explains why I was so baffled to not finding any webpack setting to override. I completely forgot Cloudflare was doing that. Disabling it fixed the problem.
Most helpful comment
This is a setting on your production environment not Gatsby - the docs are saying to disable HTML minification on your CDN or web server you have deployed the site to.
For example, if you use Cloudflare you should disable HTML under Speed -> Auto Minify as it'll strip out HTML comments as part of the minification and break React.