webpack#Module TypeScript Examples

The following examples show how to use webpack#Module. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: pack-external-module.ts    From malagu with MIT License 6 votes vote down vote up
/**
 * Find the original module that required the transient dependency. Returns
 * undefined if the module is a first level dependency.
 * @param {Object} issuer - Module issuer
 */
// eslint-disable-next-line no-null/no-null
function findExternalOrigin(stats: Stats, issuer: Module | null): any {
    if (!isNil(issuer) && (issuer as any).rawRequest.startsWith('./')) {
        return findExternalOrigin(stats, stats.compilation.moduleGraph.getIssuer(issuer));
    }
    return issuer;
}
Example #2
Source File: pack-external-module.ts    From malagu with MIT License 5 votes vote down vote up
function isExternalModule(module: Module): boolean {
    return module.identifier().startsWith('external ') && !isBuiltinModule(getExternalModuleName(module as ExternalModule));
}