jquery-modal
jquery-modal copied to clipboard
Missing 'jquery' dependencies in package.json
Thanks for the awesome modal implementation.
This issue is caused by #162
In the end of the article referenced in #162 , https://blog.npmjs.org/post/112712169830/making-your-jquery-plugin-work-better-with-npm , the author said something important which was not included in the PR.
Note: because you are using `require` to pull in jQuery here,
you’ll need to add it as a dependency in `package.json`:
"dependencies": {
"jquery": "^2.1.3"
}
Personally I think the dependency and CommonJS code is not necessary. The nodejs user could always add
window.jQuery = window.$ = require('jquery');
to their project for compatibility. But adding the CommonJS code will preventing the nodejs user using a shared jQuery instance.
Is it better to add a dependency or just remove the CommonJS code, and let user manually bind their jquery instance to the global variable ('jQuery, or $')? Or check the existence of global jQuery before require('jquery').
I don't know which one is better, but current scenario seems not right anyway: the dependency is empty but the code require 'jquery' internally.