Migrate to ES2020 modules someday
Right now, the TypeScript compiler targets ES5, which generates non-native JS modules. We don't use Webpack or Babel or anything. The index.html page loads all of the .js files with
To target ES6, we'd have do a bunch of things, like add ".js" to all the import declarations, use dynamic imports, and fix all the Node tests. Having tried this a couple of times, it is fiddly.
Only ES2020 has dynamic imports, and not many browsers support them in web workers. So we are going to still probably use importScripts().
Now using esbuild -> IIFE (.js) for the worker only. So "make tsweb" will start both tsc and esbuild in the background.
Now using esbuild -> ES2017 for the non-worker modules, so "make tsweb" starts two copies of esbuild in the background. It's still faster than tsc.
Fully dynamic imports are not allowed, so src/platforms/_index links to each platform file so that esbuild can do code splitting.
esbuild creates a lot of trash, just cancel and restart make tsweb to clean out the gen/ folder.
Still some work to do to merge the rest of the libraries, like javatari and everything else in lib/