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

allow use as CommonJS #19

Merged
merged 1 commit into from
Mar 2, 2015
Merged

allow use as CommonJS #19

merged 1 commit into from
Mar 2, 2015

Conversation

bashmish
Copy link
Contributor

@bashmish bashmish commented Mar 1, 2015

jQuery and window.jQuery are equal in context of simple page include.

Its impossible to use this plugin in context of CommonJS/WebPack because the shim requires to set jQuery dependancy outside the module and setting it global (window.jQuery) is just wrong, so usually you just set argument 'jQuery' in your shim to jquery like this

require('imports?jQuery=jquery!is-in-viewport');

More on this http://webpack.github.io/docs/shimming-modules.html

jQuery and window.jQuery are equal in context of simple page include.

Its impossible to use this plugin in context of CommonJS/WebPack because the shim requires to set jQuery dependancy outside the module and setting it global (window.jQuery) is just wrong, so usually you just set argument 'jQuery' in your shim to jQuery like this

    require('imports?jQuery=jquery!is-in-viewport');

More on this http://webpack.github.io/docs/shimming-modules.html
zeusdeux added a commit that referenced this pull request Mar 2, 2015
@zeusdeux zeusdeux merged commit bbd9dc7 into zeusdeux:master Mar 2, 2015
@zeusdeux
Copy link
Owner

zeusdeux commented Mar 2, 2015

LGTM. Landed in 2.2.3. 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

Successfully merging this pull request may close these issues.

2 participants