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

Implement CommonJS + AMD + Browser Globals pattern (Fixes #3) #21

Closed
wants to merge 1 commit into from
Closed

Implement CommonJS + AMD + Browser Globals pattern (Fixes #3) #21

wants to merge 1 commit into from

Conversation

kitten
Copy link

@kitten kitten commented Apr 27, 2015

This commit modifies the function form of the module to implement
a pattern, that loads the module in CommonJS, AMD and Browser
Globals. Therefore it tackles #3.
Sprint can now be loaded in any CommonJS-like environment,
AMD-like environments and regularly in the browser.

  • Call the function wrapper with the global this
  • Make Sprint a local variable
  • Export Sprint for AMD and CommonJS
  • Set this.$ and this.Sprint for browsers

This commit modifies the function form of the module to implement
a pattern, that loads the module in CommonJS, AMD and Browser
Globals. Therefore it tackles #3.
Sprint can now be loaded in any CommonJS-like environment,
AMD-like environments and regularly in the browser.

* Call the function wrapper with the global this
* Make Sprint a local variable
* Export Sprint for AMD and CommonJS
* Set `this.$` and `this.Sprint` for browsers
@kitten kitten mentioned this pull request Apr 27, 2015
@madbonkey
Copy link

+1

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