Electron: jQuery is not defined

前端 未结 19 2473
我在风中等你
我在风中等你 2020-11-22 06:20

Problem: while developing using Electron, when you try to use any JS plugin that requires jQuery, the plugin doesn\'t find jQuery, even if you load in the correct path using

19条回答
  •  醉话见心
    2020-11-22 07:07

    A better and more generic solution IMO:

    
    
    
    
        
        
    
    
    
    

    Benefits

    • Works for both browser and electron with the same code
    • Fixes issues for ALL 3rd-party libraries (not just jQuery) without having to specify each one
    • Script Build / Pack Friendly (i.e. Grunt / Gulp all scripts into vendor.js)
    • Does NOT require node-integration to be false

    source here

提交回复
热议问题