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


TypeScript systemjs-builder.config函数代码示例

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


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

示例1: Builder

gulp.task('!bundle', ['!build:system'], () => {
  var builder = new Builder();
  builder.config({
    map: {
      'worker': 'dist/src',
      '@angular': 'node_modules/@angular',
      'rxjs': 'node_modules/rxjs',
      'reflect-metadata': 'node_modules/reflect-metadata/temp/Reflect.js',
      'jshashes': 'node_modules/jshashes/hashes.js'
    },
    packages: {
      'worker': {
        defaultExtension: 'js'
      },
      'rxjs': {
        defaultExtension: 'js'
      },
      '@angular/core': {
        defaultExtension: 'js',
        main: 'index.js'
      },
      'reflect-metadata': {
        format: 'global'
      }
    }
  });
  builder.buildStatic('worker/browser_entry', 'dist/worker.js');
});
开发者ID:Splaktar,项目名称:mobile-toolkit,代码行数:28,代码来源:gulpfile.ts

示例2: Builder

export = (done: any) => {
  const options = {
    normalize: true,
    runtime: false,
    sourceMaps: true,
    sourceMapContents: true,
    minify: true,
    mangle: false
  };
  const builder = new Builder('./');
  builder.config({
    paths: {
      'n:*': 'node_modules/*',
      'rxjs/*': 'node_modules/rxjs/*.js',
    },
    map: {
      'rxjs': 'n:rxjs',
    },
    packages: {
      'rxjs': {main: 'Rx.js', defaultExtension: 'js'},
    }
  });
  builder.bundle('rxjs', 'node_modules/.tmp/Rx.min.js', options)
    .then(() => done())
    .catch((error: any) => done(error));
};
开发者ID:albogdano,项目名称:angular2-para,代码行数:26,代码来源:build.bundle.rxjs.ts

示例3: Builder

module.exports = () => {
  const options = {
    'normalize': true,
    'runtime': false,
    'sourceMaps': true,
    'sourceMapContents': false,
    'minify': true,
    'mangle': false
  };
  const builder = new Builder('./');
  builder.config({
    'paths': {
      'n:*': 'node_modules/*',
      'rxjs/*': 'node_modules/rxjs/*.js',
      'rxjs/internal-compatibility': 'node_modules/rxjs/internal-compatibility/index.js',
      'rxjs/testing': 'node_modules/rxjs/testing/index.js',
      'rxjs/ajax': 'node_modules/rxjs/ajax/index.js',
      'rxjs/operators': 'node_modules/rxjs/operators/index.js',
      'rxjs/webSocket': 'node_modules/rxjs/webSocket/index.js',
    },
    'map': {
      'rxjs': 'n:rxjs'
    },
    'packages': {
      'rxjs': { 'main': 'index.js',  'defaultExtension': 'js' }
    }
  });
  return builder.bundle('rxjs/index.js + ' +
  'rxjs/operators/index.js + ' +
  'rxjs/internal-compatibility/index.js + ' +
  'rxjs/testing/index.js + ' +
  'rxjs/ajax/index.js + ' +
  'rxjs/webSocket/index.js',
  'node_modules/.tmp/Rx.min.js', options)
    .then((output: any) => {
      const writeFile = promisify(fs.writeFile);
      const code = output.source.replace(/rxjs\/index/gm, 'rxjs');
      return writeFile('node_modules/.tmp/Rx.min.js',
        (options.sourceMaps)
          ? code + `\n//# sourceMappingURL=Rx.min.js.map`
          : code);
    });
};
开发者ID:NickyDo,项目名称:angular-seed-1,代码行数:43,代码来源:bundle.rxjs.ts

示例4: Builder

gulp.task('task:worker:bundle', done => {
  var builder = new Builder();
  builder.config({
    map: {
      'worker': 'dist/src/worker',
      'rxjs': 'node_modules/rxjs',
      'jshashes': 'node_modules/jshashes/hashes.js'
    },
    packages: {
      'worker': {
        defaultExtension: 'js'
      },
      'rxjs': {
        defaultExtension: 'js'
      }
    }
  });
  builder
    .buildStatic('worker/browser_entry', 'dist/worker.js')
    .then(() => done());
});
开发者ID:iller7,项目名称:mobile-toolkit-ng,代码行数:21,代码来源:gulpfile.ts

示例5: function

gulp.task('build-ts', function () {
    var opts = {
        basedir: config.paths.app,
        debug: true
    };

    var builder = new Builder;

    builder.config({
        baseUrl: './',
        defaultJSExtensions: false,
        transpiler: 'typescript',
        map: {
            typescript: 'node_modules/typescript/lib/typescript.js'
            //typescript: 'node_modules/plugin-typescript/lib/plugin.js'
        },
        packages: {
            "modules": {
                "main": "main",
                "defaultExtension": "ts",
                "meta": {
                    "*.ts": {
                        "loader": "typescript"
                    }
                }
            }
        }
    });

    builder.buildStatic('./main.ts', './main.js', { minify: false, sourceMaps: false })
        .then(function () {
            console.log('Build complete');
        })
        .catch((err: any) => {
            console.log('Build error');
            console.log(err);
        });

});
开发者ID:alekspolitov,项目名称:TypeScriptTest,代码行数:39,代码来源:gulpfile.ts


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