-
Notifications
You must be signed in to change notification settings - Fork 18
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
Using poly with no commonjs or amd #34
Comments
Guess we need a meta-poly to polyfill the polyfill. :) |
Hey @aeisenberg! Poly was designed to be used in amd and commonjs environments. The simplest option would probably be to browserify whatever poly module you need (like poly/all, poly/es5, or just poly/function if that's all you need). Using browserify's standalone option is usually a good way to build a modular library into a script that's loadable via Here's an example from when.js's package.json of the browserify command that can be used to build when.js for non-modular environments. I bet something similar would work for poly, like: If that doesn't seem like a workable option, you could try es5-shim. Hope that helps! |
Thanks @briancavalier. I'll try browserify. The main reason we want to use poly is for its modularity and so we can keep things small. With es5-shim, we'd have to include the whole shebang, which is not needed in our case. |
Cool, let us know how it goes. |
Hey @aeisenberg, here's what another user tried successfully: #28 (comment) |
I updated the docs: https://github.com/cujojs/poly/blob/master/README.md#can-i-use-poly-without-a-module-loader Hey @aeisenberg , I'm closing this for now, but please reopen it if you have any further issues. -- John |
Thanks! Works for me! |
In our environment, we are not using commonjs or amd (only angularjs modules). I'm not able to load function.js (or any module for that matter) when not using these module systems. Any suggestions on how to do this?
The text was updated successfully, but these errors were encountered: