Skip to content
Advertisement

In webpack, what does CompatibilityPlugin do?

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;
    ...

Advertisement

Answer

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

Currently useless. Ensures compatibility with other module loaders.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement