MojoJojo
MojoJojo

Reputation: 4232

npm browserify version of jquery-select2 version 4.x

I was wondering if :

  1. There is a browserif'ied version of jquery-select2 4.x plugin available via npm?
  2. If not, what do I need to do in order to get jquery-select2 4.x to work with my npm/browserify based project?

I was looking at the source on github and it seems like there is a require/almond.js version available. Can the same version be used with browserify without any changes?

I'm slightly confused as to what exactly am I required to do if I want to use jquery-select2 plugin with my project that uses npm and browserify?

Thanks in advance.

Upvotes: 2

Views: 1327

Answers (3)

FranBran
FranBran

Reputation: 1027

As of today, you can simply load the latest version of Select2 at https://www.npmjs.com/package/select2.

Just install it by using npm install select2

Upvotes: 2

Jan
Jan

Reputation: 1604

There seems to be an issue in select2-4.0.0 when used in node/browserify environment. Until this issue is resolved you can depend on the issue creator's fork where it seems solved by pulling in {"select2": "leftmostcat/select2"} (instead of select2/select2) as dependency from within your package.json.

Upvotes: 2

marcel
marcel

Reputation: 3149

I had that problem too. I solved that by adding the plugin with a script-tag to the page.

There ist no npm module for that plugin. There is only ember-select-2, a wrapper for jQuery select 2, but i don't know, if it ist the same. Just try it. But my above solution schuld work anyway.

Upvotes: 0

Related Questions