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

Provide uncompressed transpiled version of fitty as part of distribution #13

Closed
Infeligo opened this issue Aug 5, 2017 · 4 comments · Fixed by #16
Closed

Provide uncompressed transpiled version of fitty as part of distribution #13

Infeligo opened this issue Aug 5, 2017 · 4 comments · Fixed by #16

Comments

@Infeligo
Copy link

Infeligo commented Aug 5, 2017

Currently, if I install fitty from npm and try to import like this

import fitty from 'fitty'

then the fitty.js file will be imported, because it is specified as the main script.

However, it is very likely that you'll get a JavaScript error, because fitty.js is written in ES6. Tools like vue-cli or create-react-app generate such Webpack config that applies Babel transpilation only to application source. In order to fix the import, I have to write import fitty from 'fitty/fitty.min.js', which is less obvious and makes IDEs life more difficult.

It would be nice if the current fitty.js is moved to e.g. src folder, and two transpiled distribution versions of the library (uncompressed and compressed) are provided.

@rikschennink
Copy link
Owner

That sounds logical, can you perhaps share articles that contain good practices concerning the main module setup? As in, should it be minimized, should it even be wrapped in a UMD? Maybe it would be more interesting to generate a fitty.module.js for use with npm. I'm quite new to this, so any resources are useful.

@Infeligo
Copy link
Author

Infeligo commented Aug 8, 2017

I haven't seen a good article with real explanations, but instead there are a lot of starters [1, 2] for library development.

@rikschennink
Copy link
Owner

Thanks, I'm looking into it.

@rikschennink
Copy link
Owner

Decided to not go with the .min file for node as the UMD wrapper and such is not necessary in that environment. If you have any feedback on this pull request ( #16 ) that would be welcomed. Tested with Browserify and seems to function correctly.

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

Successfully merging a pull request may close this issue.

2 participants