common-exports
    Preparing search index...

    Function resolveImports

    • Given a file with buffer contents, identify all the imports it has and find their full paths. Common (already CommonJS-compatible) modules are included too, not just modules needing conversion - see module:common-exports.ModuleInfo's isCommon flag, used by module:common-exports.replaceImports to copy them into the vendor tree as-is rather than converting them. They can't simply be left alone: the vendor output directory structure doesn't mirror the original node_modules layout closely enough for Node's own module resolution to find them from their new location.

      Parameters

      • file: StreamFile

        The in-memory fetched file object.

      • rootPath: string = null

        The root path to use when resolving imports.

      Returns ModuleInfo[]

      module:common-exports