I am working with reactjs and I need to import $
globally in my webpack.
I know I can import in each component like this
import $ from 'jquery'
But it is being used in every component so I want to avoid from writing it in every component. So how do I do this using webpack or there is any other way to do this
I have added this in webpack but stills doesn't work
module: {
strictExportPresence: true,
rules: [
{
test: require.resolve('jquery'),
use: [{
loader: 'expose-loader',
options: '$'
}]
}
],
},
Any help would be appreciated!!!