I\'m using Webpack in my application, in which I create two entry points - bundle.js for all my JavaScript files/codes, and vendors.js for all libraries like jQuery and Reac
In your webpack.config.js file add below:
var webpack = require("webpack");
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
],
Install jQuery using npm:
$ npm i jquery --save
In app.js file add below lines:
import $ from 'jquery';
window.jQuery = $;
window.$ = $;
This worked for me. :)