Skip to content

CommonJS support (Browserify, stitch, etc...) #6

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

Merged
merged 2 commits into from
Nov 27, 2012

Conversation

ericelliott
Copy link
Contributor

Export the module API!

@@ -218,4 +218,7 @@ window.lightningjs || (function(window, parentLightningjs){
})
}

})(window, window.parent.lightningjs);
if (module && module.exports) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you meant if (typeof module !== "undefined" && module.exports) (avoids ReferenceError in non-CommonJS envs when module is not defined)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Yes, of course. =)

@mjpizz
Copy link
Member

mjpizz commented Nov 23, 2012

Thanks Eric! Good call. I assume you're using this like:

var lightningjs = require("lightningjs");
lightningjs.provide({foo: ...})

or something along those lines?

@ericelliott
Copy link
Contributor Author

var lightningjs = require("lightningjs");
lightningjs.provide({foo: ...});

That's pretty much exactly what we're doing. =)

mjpizz added a commit that referenced this pull request Nov 27, 2012
CommonJS support (Browserify, stitch, etc...)
@mjpizz mjpizz merged commit b7edc73 into olark:master Nov 27, 2012
@mjpizz
Copy link
Member

mjpizz commented Nov 27, 2012

sweet, looks good with the fix.

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

Successfully merging this pull request may close these issues.

2 participants