vodkabears / Remodal

No longer actively maintained.
http://vodkabears.github.io/remodal/
MIT License
2.75k stars 771 forks source link

Browserify-shim compatibility? #178

Closed pixelwhip closed 8 years ago

pixelwhip commented 9 years ago

Thanks for sharing this. I'm having trouble bundling this into an existing project using browserify-shim to require jQuery.

I have this in my src file

var $ = require('jquery');
require('remodal');

jQuery 1.10.2 is already loaded globally. I'm using browserify-shim with the following settings in package.json.

"browserify-shim": {
    "jquery": "global:jQuery"
  },

This does populate the $ variable correctly and bundles to the following

var $ = (typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null);
require('remodal');

But I get this error in the console from Remodal.

Uncaught Error: Cannot find module 'jquery'

Any ideas on what I might be doing wrong here?

vodkabears commented 9 years ago

Workaround: https://github.com/thlorenz/browserify-shim/issues/46#issuecomment-70430112

U can install v1.11.x from npm and use it without any shims.

pixelwhip commented 9 years ago

Thanks! I'll give that a try.

pixelwhip commented 8 years ago

I tried the above workaround and it didn't fix the issue.