当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript requirejs-shim.require类代码示例

本文整理汇总了TypeScript中@hpcc-js/requirejs-shim.require的典型用法代码示例。如果您正苦于以下问题:TypeScript require类的具体用法?TypeScript require怎么用?TypeScript require使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了require类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: dev

export function dev(additionalPaths: { [key: string]: string } = {}): any {
    window.__hpcc_topoJsonFolder = `${hostUrl}/map/TopoJSON`;
    const thirdPartyPaths: { [key: string]: string } = {};
    for (const key in npmPackages) {
        thirdPartyPaths[key] = `${hostUrl}/../node_modules/${npmPackages[key]}`;
    }
    const paths: { [key: string]: string } = {
        ...thirdPartyPaths,
        ...additionalPaths
    };
    const rjsPackages: any = [];
    hpccShims.forEach(shim => {
        paths[`@hpcc-js/${shim}`] = `${hostUrl}/${shim}/dist/index`;
    });
    packages.forEach(pckg => {
        paths[`@hpcc-js/${pckg}`] = `${hostUrl}/${pckg}`;
        rjsPackages.push({
            name: `@hpcc-js/${pckg}`,
            main: "lib-umd/index"
        });
    });
    return requirejs.config({
        context: hostUrl,
        paths,
        packages: rjsPackages,
        shim: requireShims
    });
}
开发者ID:GordonSmith,项目名称:Visualization,代码行数:28,代码来源:requirejs.ts

示例2: reqListener

 function reqListener() {
     const pkg = JSON.parse(this.responseText);
     console.log(`Configuring require from ${pkg.name}@${pkg.version} from ${url}`);
     const topoJsonUrl = `${pkgUrl(pkg, "@hpcc-js/map")}/TopoJSON`;
     window.__hpcc_topoJsonFolder = topoJsonUrl;
     const paths: { [key: string]: string } = {
         "@hpcc-js/map/TopoJSON": topoJsonUrl,
         ...additionalPaths
     };
     for (const key in pkg.dependencies) {
         paths[key] = `${pkgUrl(pkg, key)}/dist/index${minStr}`;
     }
     resolve(requirejs.config({
         context: url,
         paths
     }));
 }
开发者ID:GordonSmith,项目名称:Visualization,代码行数:17,代码来源:requirejs.ts

示例3: cdn

export function cdn(url: string, min: boolean = true, additionalPaths: { [key: string]: string } = {}): any {
    console.log("Deprecated - please use 'amd'");
    window.__hpcc_topoJsonFolder = `${url}/map/TopoJSON`;
    const minStr = min ? ".min" : "";
    const paths: { [key: string]: string } = {
        "@hpcc-js/map/TopoJSON": `${url}/map/TopoJSON`,
        ...additionalPaths
    };
    hpccShims.forEach(shim => {
        paths[`@hpcc-js/${shim}`] = `${url}/${shim}/dist/index${minStr}`;
    });
    packages.forEach(pckg => {
        paths[`@hpcc-js/${pckg}`] = `${url}/${pckg}/dist/index${minStr}`;
    });
    return requirejs.config({
        context: url,
        paths
    });
}
开发者ID:GordonSmith,项目名称:Visualization,代码行数:19,代码来源:requirejs.ts


注:本文中的@hpcc-js/requirejs-shim.require类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。