ReferenceError: jquery is not defined

Hi!

My project used bootstrap and it required jquery.

I include jquery in config

plugins: [
    new webpack.ProvidePlugin({
      $: 'jquery',
      jQuery: 'jquery',
      'window.jQuery': 'jquery',
      angular: 'angular',
      _s: 'underscore.string',
      _: 'underscore'
    }),
    new webpack.IgnorePlugin(/^\.\/locale$/, [/moment$/]),
  ],
  module: {
    loaders: [
      { test: /[\/]angular\.js$/, loader: "exports?angular" },
      { test: /magnific-popup/, loader: "exports?jquery" },
      { test: /linkify/, loader: "exports?jquery" },
      { test: /cropper/, loader: "exports?jquery" },
      { test: /perfect-scrollbar/, loader: "exports?jquery" },
      { test: /bootstrap/, loader: "exports?jquery" },
      { test: /moment-timezone-2010-2020/, loader: "exports?moment" }
    ]
  },
resolve: {
    extensions: ['', '.js'],
    root: [ __dirname + '/public/app' ],
    alias: {
      'jquery': __dirname + '/public/vendors/jquery/dist/jquery',

And i getting error in my browser after build

/*** EXPORTS FROM exports-loader ***/
    module.exports = jquery
/* WEBPACK VAR INJECTION */

Author: Fantashit

1 thought on “ReferenceError: jquery is not defined

Comments are closed.