Electron: jQuery is not defined

前端 未结 19 2953
我在风中等你
我在风中等你 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:03

    I face the same issue and this worked for me!

    Install jQuery using npm

    $ npm install jquery
    

    Then include jQuery in one of the following ways.

    Using script tag

    
    

    Using Babel

    import $ from 'jquery';
    

    Using Webpack

    const $ = require('jquery');
    

提交回复
热议问题