Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distribute files for each type #19

Open
OliverJAsh opened this issue Sep 1, 2017 · 3 comments
Open

Distribute files for each type #19

OliverJAsh opened this issue Sep 1, 2017 · 3 comments

Comments

@OliverJAsh
Copy link

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.

@jklmli
Copy link
Owner

jklmli commented Sep 1, 2017

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

@OliverJAsh
Copy link
Author

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.

@jklmli
Copy link
Owner

jklmli commented Sep 2, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants