When attempting to load my bundled script file in the browser I get:
Uncaught ReferenceError: jQuery is not defined
Which is supposedly coming from the the last line in my bundled underscore-min.js
being the issue:
}()
Which doesn't make any sense? I'm not sure if something with the source map file is leading me astray. My configuration is such in webpack.config.js
:
entry: {
main: [
'./js/jquery.min.js',
'./js/other.js',
'./js/other2.js',
'./js/underscore-min.js'
]
},
...
plugins: {
...
new webpack.ProvidePlugin({
jquery: 'jquery',
jQuery: 'jquery',
}),
...
}
...
externals: {
'jquery': 'jQuery',
'jQuery': 'jQuery',
}
And without the above, heaps of other packages freak out which depend on jQuery. Is there something unique about the underscore-min.js
script that is causing this?