Back to Webpack Js Org

ContextExclusionPlugin

src/content/plugins/context-exclusion-plugin.mdx

4.41.2459 B
Original Source

Context refers to dynamic expressions in import() or require() 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

js
export default {
  plugins: [new webpack.ContextExclusionPlugin(/dont/)],
};