This serves 2 goals:
1. Wait for the script to be injected (when the promise is resolved),
so future `sendMessageToPage` won't happen before the script can
respond.
2. Detect errors in the script injection (when the promise is
rejected).
Use wasm-bindgen's built-in loader instead of relying on Webpack.
In order to still respect the `publicPath` config, set
`__webpack_public_path__` just before fetching the WebAssembly module.
This allows to no longer declare `.wasm` files as resource assets in
each `webpack.config.js`.
This simplifies the `publicPath` function and makes it useable inside
`fetchRuffle`.
Assuming `publicPaths` isn't used anywhere, this shouldn't be harmless.
In direct SWF mode, paths used to be resolved relative to the
extension URL, which is invalid. Change it to be relative to the
SWF location, using the `base` option.
* Remove `buildProduction` as it was equivalent to `build`.
* Fix `build:avm_debug` and change it to `build:debug`, which also
disables Webpack optimizations.
* `eslint:recommended` is not needed in the each file as it already
appears in the root config.
* The default `@typescript-eslint/naming-convention` rule is preferred.
* Other formatting improvements.