Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
The built version of Chosen only works with browser globals. Browser globals are falling out of fashion in favor of using module loaders, like AMD or CJS. Unfortunately, it's a bit of a pain for developers using those systems to integrate Chosen into them.
You can support the most common use cases of Chosen with a (fairly ugly) wrapper. Chosen's wrapper looks like this.
There's no question that it really sucks to include the wrapper, because it's added source code, but some folks feel that the benefits outweigh the cons. Some of the benefits are:
Applying the wrapper can be easily done with an extra grunt task. I usually use
If you add the wrapper, I would suggest that you add the repo to npm. Then, you could run