I'm considering developing a TypeScript library for distributions that will rely on cephes
.
To enable the use of web assembly in browsers, we need to compile it in the following way:
const cephes = require('cephes'); // Browser
await cephes.compiled;
I'm unsure about how to implement this for a Typescript library that wraps cephes.
For instance, the library will provide a NormalDistribution that can be imported like this:
import { NormalDistrbution } from 'cephesdistributions';
If tree shaking is performed, NormalDistribution may be the only import included from the package. Should we then include await cephes.compiled
in all modules offered by cephesdistributions
?