uglifify was being applied inline, which only resulted in one asset. With this we've gone back to using `terser` to generate the minified version of the browser bundle, which also exports sourcemaps interpretted from browserify.
The babelify options have changed to ensure that browser-safe code gets published so terser can more effectively parse it. It doesn't like things like classes it seems, but is fine with let/const and such. The preset-env preset automatically knows it is targeting a browser.
We release with Node 10 currently, so we should use that. The browser bundle is minfied because we want to keep it, so we might as well shave about 1mb off of it.
Now that we're pointing at `src/` for tests, we can stop trying to load source maps from random places. With this dependency used, source maps are off by a few lines.
Having them in `src/` helps IDEs do autocomplete a bit more nicely, and helps us not get confused about which one is referencing which. They have also been converted to TypeScript for typings to be generated.
The earlier commit, d3ce0cb82f, has most of the juicy details on this. In addition to d3ce's changes, we also:
* Use `TestClient` in many integration tests due to subtle behaviour changes in imports when switching to ES6. Namely the behaviour where setting the request function is less reliable in the way we did it, but `TestClient` is very reliable.
* We now use the Olm loader more often to avoid having to maintain so much duplicate code. This makes the imports slightly easier to read.
For https://github.com/vector-im/riot-web/issues/8880
Features:
* Export modern JS
* Export typings
* Export source maps that actually mean something
* No longer supporting minified builds
This is a step towards being a boring SDK and not anticipating an install location.
This commit requires a major version bump of the SDK.