I’m trying out webpack (http://webpack.github.io/) and it looks really nice, however I’m kind of stuck here.
Say that I’m using a CDN for a library, f.ex jQuery. Then in my code, I want the require('jquery')
to automatically point to the global jquery instance, instead of trying to include it from my modules.
I’ve tried using plugins like the IgnorePlugin
:
new webpack.IgnorePlugin(new RegExp("^(jquery|react)$"))
This works for ignoring the library, but it still says that the required module is "missing" when I run the webpacker.
Somehow I need to tell webpack that jquery
should be picked up from the global context instead. Seems like a common use case, so I’m kind of surprised that the docs doesn’t target this specifically.