Module not found: Error: Cannot resolve module 'jquery'
jeerbl opened this issue · 2 comments
jeerbl commented
Hello,
When define
is defined and define.amd
exists, it defines the module with a dependency on jQuery as you can see in the code below:
if (typeof define === 'function' && define.amd) {
define(['jquery'], function() {
return Odometer;
});
} else if (typeof exports !== "undefined" && exports !== null) {
module.exports = Odometer;
} else {
window.Odometer = Odometer;
}
My project does not use jQuery and, when packaging with Webpack, I get the error
ERROR in ./~/odometer/odometer.js
Module not found: Error: Cannot resolve module 'jquery' in /Users/jbrunel/Documents/Projects/TrackInsight/view/src/public/map/node_modules/odometer
@ ./~/odometer/odometer.js 644:4-646:6
Is there any reason why there is a dependency on jQuery when using define
but not in the other cases?
I can provide a pull request to fix this if you are OK.
Thanks,
Jerome