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

Use with RequireJS – Standalone Build #89

Closed
justincobb opened this issue Aug 28, 2013 · 8 comments
Closed

Use with RequireJS – Standalone Build #89

justincobb opened this issue Aug 28, 2013 · 8 comments

Comments

@justincobb
Copy link

How would I go about incorporating this library with RequireJS? If I use the standalone fn.selectize never gets called in the load. Looks like it breaks before it gets there. I could break them out and load them through the RequireJS optimizer. I found sifter.js but was not able to find microplugin.js.

Or is there any option to get a package that would work with RequireJS?

Thanks

@brianreavis
Copy link
Member

The standalone build currently will only work in non-RequireJS environments. All the modules are anonymous and bundled in the same file, so RequireJS doesn't know what is what. I'm currently working on a tool for flattening out the dependencies—which will fix this problem. I hope to have this done in the next day or two.

In the meantime, adding sifter.js, microplugin.js, and selectize.js as separate files to your project should work.

@KidkArolis
Copy link

It would work if define(factory); would be replaced with define('sifter', factory); and same for define('microplugin', factory); in the standalone file. It's fine for 3 modules to be in one file as long as they're not all anonymously defined.

But 3 separate files is a better solution anyways.

@thilotanner
Copy link

I encountered a similar issue: how do I use selectize with requirejs properly? I created three module files, microplugin.js, sifter.js and selectize.js and used something like

define(['selectize','jquery'], function(selectize, $) { ... });

to load selectize, but I get the following error:

RequireJS error: define: Syntax error, unrecognized expression: unsupported pseudo: required, modules multiselect 

@mefjuu
Copy link

mefjuu commented Oct 23, 2013

I've tried to asynchronously load Selectize with RequireJS or Yepnope. After load, the "Selectize" class is undefined in both cases.

@thilotanner
Copy link

I just realized, that the issue described in my comment above, was a problem with JQuery 1.9.1:

#164

Loading selectize with requirejs is working, as long as sifter.js, microplugin.js, and selectize.js are in separate files.

@glenselle
Copy link

Was there any progress made on this?

@hugohenrique
Copy link

ping

@brianreavis
Copy link
Member

Sorry for the delays on this one, guys. All anonymous modules are now removed in the standalone build (which should fix the problems, as @KidkArolis mentioned). Check out v0.8.5.

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

No branches or pull requests

7 participants