Refine the `dist` step by creating a proper temporary file.
I spent a lot of time trying to pinpoint the underlying cause, why
translation chunk files are empty when generating a bundle with newer JS
features (i.e. not pinning preset-env to IE11) but couldn't find it.
Found another bug while trying to make the release.
Running `npm run nodeps` last breaks dynamic importing of the DayJS
translations. I'm not sure why, I think maybe because of broken `.map`
files.
The fix for now is to move the js-po files out of the way, and then copy
them back in after running `npm run build`.
Hopefully all of this won't be necessary with gettext 0.22 which should
support template literals
I've now also figured out why loading of chunks failed when running
using converse.js (but not when using converse.min.js or when running `make watch`).
When running `make dist`, first `converse.js` and `converse.min.js` were
built with `mode` set to `development` (via `webpack.dev.js`) and then
`converse.min.js` was again built with mode set to `production` (via
`webpack.prod.js`).
When running only one build or the other (either `webpack.dev.js` or
`webpack.prod.js`) then the loading of chunks didn't fail, so it had
something to do with running both builds back to back.
I've now removed the `.dev.js` webpack config files and instead build
the minimized and non-minimized from the same config file
`webpack.build.js`.
I did the same for the headless builds.
Had to make various other changes due to incompatibilities.
- Use the new `lit` package instead of `lit-html` or `lit-element`
- Drop `haunted` since it breaks the rules by specifying `type: module`
but then doesn't import with file extensions
- Use Sass Dart instead of node-sass (fixes#2445)
- Upgrade Karma