This described in https://github.com/vector-im/element-web/issues/17330#issuecomment-842530812, this should prevent the newly introduced version of `html-webpack-plugin` from minifying `.html` files, like e.g. `index.html`, `jitsi.html`, et cetera …
Quoting @jryans via: https://github.com/vector-im/element-web/issues/17330#issuecomment-842415694
> The content of the `index.html` file is not a supported API surface, so it might change at any time.
>
> This document minification was not done on purpose, but instead it happened as a side effect of upgrading. We would happily accept a PR to fix this, but it is also not a priority for the core team.
Could please someone test and, hopefully, accept this change back to not minifying the `.html` files?
While it sounds like a useful warning at first, it turns out the warnings it
prints are ones we're unlike to ever act on, such as adding percentages and
pixels, which seem fine to have. This resets to default behaviour, which leaves
the warning off.
With the approach in https://github.com/vector-im/element-web/pull/16969,
Webpack seems to sometimes do what we want, sometimes not... I haven't quite
worked out why. Perhaps there's some conflict or race in Webpack's defaults...?
This new approach seems to work as expected when running
`./scripts/ci_package.sh`, which matches what development deployments are doing.
When running Nightly build we want to benefit from the fast runtime that React production offers and get rid of the runtime overhead that comes with development.
We are setting NODE_ENV and not "webpack.mode" to not loose sourcemaps and have minified sources in that environment
This adjusts our asset path handling to group KaTeX fonts in a more sensible way
alongside the other fonts we have. It also resolves production build issues on
Windows.
Fixes https://github.com/vector-im/element-web/issues/15911
We don't need to manually define `NODE_ENV` in the Webpack config, nor do we
need to set it outside Webpack with `cross-env` either, as Webpack's modes will
take care of this for us.