-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add Support For Environments Without require()
#1
Comments
Hello, I'll try to provide separate builds with UMD. btw. did you consider using browserify? |
It certainly is a possibility, but it's also an additional dependency that is both easy to avoid and could easily grossly complicate a setup, particularly if the project already uses something like require.js. |
Point of fact, I have a current project that uses require.js and AMD modules. It has a case in it where this code would be a big help, and I'd pull this into that project in a heart-beat, except for the difficulty of integration with the module system that I'm using. |
Just wanted add a 👍 to this. I am in a situation where this would be perfect but our code base isn't using commonjs or requirejs and not really interested in adding browserify. |
Now there's a build which exports
|
That works for me. Thanks! |
I like the idea behind your library, but the user must have
require()
defined with how it is currently written. There is a pattern for being able to support CommonJS, AMD, and plain-old globals called UMD, or Universal Module Definition. I'd submit a pull request, but I don't know CoffeeScript.The UMD pattern with the broadest environment support:
https://github.com/umdjs/umd/blob/master/commonjsStrict.js
The text was updated successfully, but these errors were encountered: