The setup below has been adapted from this browserify-shim example.
The code can simply require(jquery)
because browserify-shim
will replace these with window.jQuery
, expecting that it will have been exposed there, loaded from a CDN via a <script>
tag. So far, this part works.
The key difference with the original example is that this code also wants to require('backbone')
(a regular npm install).
Backbone also does a require('jquery')
and I was expecting this to just work too.
Except, that it doesn't, as this statement will demonstrate: