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

Should this provide a UMD / minified version? #9

Closed
JedWatson opened this issue Feb 14, 2015 · 5 comments
Closed

Should this provide a UMD / minified version? #9

JedWatson opened this issue Feb 14, 2015 · 5 comments
Labels

Comments

@JedWatson
Copy link
Owner

Since it's published to Bower (#7) some people may just want to be able to drop it into their page, so we'll need to include a build (via browserify / web pack) for that. Might be nice to dist a .min version too, even though it's tiny.

@chenglou thoughts?

JedWatson added a commit that referenced this issue Feb 14, 2015
@JedWatson
Copy link
Owner Author

I wrapped a simple try/catch around the export statement, not a proper solution but this way if it's included directly it'll expose a global classNames function and not throw an error if module is undefined.

@chenglou
Copy link
Contributor

Here's how I do it: https://github.com/chenglou/react-treeview/blob/master/react-treeview.jsx

Also, I don't usually provide a min inside repo too. Bower users will probably just add that to the list of things they need to minify anyways.

@JedWatson
Copy link
Owner Author

Started borrowing your code from react-treeview but it's so much simpler because I don't need React defined, so I just changed it to a simple if (module && module.exports) check. I think that covers enough cases and agree about magnification.

Feel free to open a PR if you've got a better way... otherwise, thanks :)

@marcfallows
Copy link

I think it would be really great if an npm install classnames provided us with an index.min.js. That is pretty common practice. Yes it's tiny, but could be even tinier 🙂

@dcousens
Copy link
Collaborator

dcousens commented Feb 1, 2017

@marcfallows why?
I'd prefer a source code I can debug and let my own build system minify.

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

No branches or pull requests

4 participants