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

CommonJS support #43

Closed
positlabs opened this issue Sep 23, 2015 · 4 comments
Closed

CommonJS support #43

positlabs opened this issue Sep 23, 2015 · 4 comments

Comments

@positlabs
Copy link

The way exports are defined in PxLoader are incompatible with CommonJS. The PxLoader script becomes un-scoped from the window, so exporting to this is useless.

CommonJS support can be added with this line:
if(module && module.exports) module.exports = PxLoader;

@andheiberg
Copy link
Contributor

Glorious man! Thanks!

@andheiberg
Copy link
Contributor

#45

@leup
Copy link

leup commented Dec 1, 2015

As pointed out by @aureliePrd there is an error where "module is not defined". (613791e#commitcomment-14711450)

I think it should use the following syntax

if (typeof module !== 'undefined' && module.exports)

joelfillmore added a commit that referenced this issue Dec 1, 2015
@daviestar
Copy link

Can you please release a tagged version including CommonJS support. Thanks.

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

5 participants