當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript vinyl-source-stream類代碼示例

本文整理匯總了TypeScript中vinyl-source-stream的典型用法代碼示例。如果您正苦於以下問題:TypeScript vinyl-source-stream類的具體用法?TypeScript vinyl-source-stream怎麽用?TypeScript vinyl-source-stream使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了vinyl-source-stream類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getBrowserCodeStream

export function getBrowserCodeStream(appName: string, opts?: PrebootOptions): any {
  opts = normalize(opts);

  let bOpts = {
    entries: [__dirname + '/../browser/preboot_browser.js'],
    standalone: 'preboot',
    basedir: __dirname + '/../browser',
    browserField: false
  };
  let b = browserify(bOpts);

  // ignore any strategies that are not being used
  ignoreUnusedStrategies(b, bOpts, opts.listen, listenStrategies, './listen/listen_by_');
  ignoreUnusedStrategies(b, bOpts, opts.replay, replayStrategies, './replay/replay_after_');

  if (opts.freeze) {
    ignoreUnusedStrategies(b, bOpts, [opts.freeze], freezeStrategies, './freeze/freeze_with_');
  }

  // ignore other code not being used
  if (!opts.buffer) { b.ignore('./buffer_manager.js', bOpts); }
  if (!opts.debug) { b.ignore('./log.js', bOpts); }

  // use gulp to get the stream with the custom preboot browser code
  let outputStream = b.bundle()
    .pipe(source('src/browser/preboot_browser.js'))
    .pipe(buffer())
    .pipe(insert.append('\n\n;preboot.init("' + appName + '",' + stringifyWithFunctions(opts) + ');\n\n'))
    .pipe(insert.append('\n\n;preboot.init("' + appName + '2",' + stringifyWithFunctions(opts) + ');\n\n'))
    .pipe(rename('preboot.js'));

  // uglify if the option is passed in
  return opts.uglify ? outputStream.pipe(uglify()) : outputStream;
}
開發者ID:StevenLudwig,項目名稱:universal,代碼行數:34,代碼來源:browser_code_generator.ts

示例2: rebundle

 function rebundle() {
     return bundler
         .bundle()
         .on('error', function(er:any)  
         {
             console.log(er.message);
             this.emit('end');
         })
         .pipe(source(dest))
         .pipe(gulp.dest(paths.dest));
 }
開發者ID:pzahoran,項目名稱:reactive-angular2,代碼行數:11,代碼來源:gulpfile.ts

示例3: browserify

		const tasks = files.map((entry: string) => {
			return browserify({ entries: [entry] })
				.bundle()
				.pipe(source(entry.replace('tmp', 'resources')))
				.pipe(gulp.dest('./built'));
		});
開發者ID:sagume,項目名稱:Misskey-Web,代碼行數:6,代碼來源:gulpfile.ts


注:本文中的vinyl-source-stream類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。