Webpack 5 has been officially released. Read our announcement. Not ready yet? Read webpack 4 documentation here.
Context refers to a require with an expression such as require('./locale/' + name + '.json')
.
The ContextExclusionPlugin
allows you to exclude context. Provide RegExp as an argument when initializing the Plugin to exclude all context that matches it.
webpack.config.js
module.exports = {
plugins: [
new webpack.ContextExclusionPlugin(/dont/)
]
};