• Helper for dynamically loading module that should work with linked dependencies. The problem is that we should be using require(require.resolve(moduleName, { paths: [cwd()] })) However it's not possible to do that with Webpack, as it has to know all the dependencies during build time. require.resolve is also not available in any other way, so we cannot create, a fake helper like we do with dynamicRequire.

    We always prefer to use local package, thus the value is not returned early from each try/catch block. That is to mimic the behavior of require.resolve exactly.

    Type Parameters

    • T

    Parameters

    • moduleName: string

      module name to require

    Returns T | undefined

    possibly required module

Generated using TypeDoc