Coder Social home page Coder Social logo

Comments (5)

marcfallows avatar marcfallows commented on July 20, 2024 1

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 🙂

from classnames.

JedWatson avatar JedWatson commented on July 20, 2024

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.

from classnames.

chenglou avatar chenglou commented on July 20, 2024

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.

from classnames.

JedWatson avatar JedWatson commented on July 20, 2024

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 :)

from classnames.

dcousens avatar dcousens commented on July 20, 2024

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

from classnames.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.