Answer the question
In order to leave comments, you need to log in
How to include plugins in webpack?
I have this perennial problem. I don’t know how to properly connect plugins in webpack and don’t know a universal way. Please teach. There is webpack.config.js:
const path = require('path');
const outputDir = path.resolve(__dirname, 'build');
module.exports = {
entry: path.resolve(__dirname, 'src/js/main.js'),
output: {
path: outputDir,
filename: 'bundle.js'
},
module: {
rules: [{
test: require.resolve('jquery'),
use: [{
loader: 'expose-loader',
options: '$'
}]
}]
}
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question