Loading Jquery with Webpack

前端 未结 1 1999

I have written a npm package (call it ABC) that I am testing out in a create react app. This package uses Webpack. My package also depends upon another package (cal

相关标签:
1条回答
  • 2021-01-26 17:10

    I have come to solve my own issue with a trivial solution. When I was using package DEF inside javascript files in my ABC package, I was including it via the import statement like so: import 'DEF';. Simply changing this to require ('DEF'); was the solution. At the moment I am investigating why this made all the difference. It should be noted that I did not need to configure my ABC's webpack configuration to handle the javascript so I have since removed the providerPlugin and externals object that accounted for the jQuery.

    This helps to explain why this is the case.

    0 讨论(0)
提交回复
热议问题