webpack Module not found: Error: Can't resolve 'jquery'

后端 未结 3 1889
春和景丽
春和景丽 2021-01-04 13:53

When I run the \'webpack\' command, I get this error:

ERROR in ./js/main.js Module not found: Error: Can\'t resolve \'jquery\' in \'...\\js\' @ ./js/main.js 3:0-16 4

3条回答
  •  清歌不尽
    2021-01-04 14:31

    Well in my case it was something about importing jquery instead of jQuery, it is a webpack config:

    externals: {
        // require("jquery") is external and available
        //  on the global var jQuery
        "jquery": "jQuery"
    }
    

    have a look at this: webpack Can't resolve 'jquery'

提交回复
热议问题