keyman
keyman copied to clipboard
refactor(web): move to es modules and appropriate build tools for bundling keymanweb.js
The js module fight seems to have resolved in favour of ES modules. It'll be some time before we can use them in browsers that we support. However, we can use bundling tools like webpack, browserify, or esbuild to transpile them into a bundle.
We should be:
- Ceasing use of namespaces
- Replacing all uses of
require()
and other, more hacky, import methods to ESMimport
. - Moving from tsc's project prepending tool to use of a bundling tool where needed for deployable artifacts
- Updating all package.json and tsconfig.json to refer to the appropriate module format.
See also #7328