monapt
monapt copied to clipboard
Distribute files for each type
The npm package currently only distributes one large JS file, including all types.
It would be great if it distributed a file for each type.
This would allow us to include Option
in our codebase, if that's the only type being used, for example.
What would this look like? import * as Option from 'monapt/option'
?
I haven't tried this, but have you tried tree-shaking with import { Option } from 'monapt'
?
import * as Option from 'monapt/option'?
That's what I was thinking!
I haven't tried this, but have you tried tree-shaking with import { Option } from 'monapt'?
I haven't tried it, but it would be great to have the separate file in any case, for when the module is imported in a module system that doesn't support tree shaking, e.g. CommonJS instead of ES Modules.
I haven't tried it, but it would be great to have the separate file in any case, for when the module is imported in a module system that doesn't support tree shaking, e.g. CommonJS instead of ES Modules.
Hmm...that's a good point. I'll see if I can come up with something.