In webpack, what does CompatibilityPlugin do?

Tags: ,



When will it work? When does require have two parameters´╝č

parser.hooks.call
    .for("require")
    .tap("CompatibilityPlugin", expr => {
    // support for browserify style require delegator: "require(o, !0)"
    if (expr.arguments.length !== 2) return;
    ...

Answer

https://webpack.js.org/plugins/internal-plugins/#compatibilityplugin

Currently useless. Ensures compatibility with other module loaders.



Source: stackoverflow