Webpack causes: jQuery not defined

Recently, I started using Webpack and I was requiring jQuery using ‘require(“jquery”)’ and then I started getting errors in my app like so:

Then I found this piece here which explained that Webpack doesn’t set any global variables, so you have to set them yourself. So I did this:

Happily this solved my issues.