Category Archives: webpack

Webpack: jQuery is not defined issue

bootstrap.js


/*
 * dashmix.app.min.js as well.
 *
 * After that change, you won't have to include dashmix.core.min.js in your pages any more
 *

*/

// Import all vital core JS files..
import jQuery from 'jquery';
import SimpleBar from 'simplebar';
import Cookies from 'js-cookie';
import 'bootstrap';
import 'popper.js';
import 'jquery.appear';
import 'jquery-scroll-lock';

// ..and assign to window the ones that need it
window.$ = window.jQuery  = jQuery;
window.SimpleBar          = SimpleBar;
window.Cookies            = Cookies;

//Following two lines are critical
global.$ = require("jquery");
global.jQuery = global.$;

Reference: