monapt icon indicating copy to clipboard operation
monapt copied to clipboard

Distribute files for each type

Open OliverJAsh opened this issue 7 years ago • 3 comments

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.

OliverJAsh avatar Sep 01 '17 17:09 OliverJAsh

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'?

jklmli avatar Sep 01 '17 22:09 jklmli

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.

OliverJAsh avatar Sep 02 '17 16:09 OliverJAsh

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.

jklmli avatar Sep 02 '17 22:09 jklmli