Webpack using bootstrap - jquery is not defined

前端 未结 7 1415
轮回少年
轮回少年 2020-11-29 00:20
import $ from \'jquery\';
require(\"./node_modules/bootstrap/dist/css/bootstrap.min.css\")
require(\"./node_modules/bootstrap/js/dropdown.js\")
import React from \'r         


        
相关标签:
7条回答
  • 2020-11-29 01:01

    this will work

    plugins: [ 
         new webpack.ProvidePlugin({
               $: "jquery", 
               jQuery: "jquery"
         })
    ] 
    

    It worked for me hope it helps

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