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


TypeScript gulp-uglify.default函數代碼示例

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


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

示例1: getBrowserCodeStream

export function getBrowserCodeStream(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(' + stringifyWithFunctions(opts) + ');\n\n'))
    .pipe(rename('preboot.js'));

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

示例2: function

gulp.task('compile-project', function () {
    var opts = {
        basedir: config.paths.app,
        debug: true
    };
    var streamFinished = function () {
        gutil.log('End stream');
    };
    var entry = config.paths.app + '/main.ts';
    var fileName = path.basename(entry, path.extname(entry)) + ".js";

    var project = ts.createProject('tsconfig_m.json', {
        outFile: fileName
    });

    var tsResult = project.src()
        .pipe(project())
        .pipe(wrap({ src: 'template.txt' }))
        .pipe(gulp.dest(config.paths.pub))
        .pipe(rename({ suffix: '.debug' }))
        .pipe(gulp.dest(config.paths.pub))
        .pipe(uglify())
        .pipe(rename(fileName))
        .pipe(gulp.dest(config.paths.pub))
        .on('end', streamFinished);
});
開發者ID:alekspolitov,項目名稱:TypeScriptTest,代碼行數:26,代碼來源:gulpfile.ts

示例3: merge

gulp.task("compile", function() {
	var tsResult = tsProject.src()
		.pipe(sourcemaps.init())
		.pipe(ts(tsProject));
	
	var dts = tsResult.dts
		.pipe(insert.transform(function(contents: string, file: any) {
			contents = contents.replace(/\/\/\/\s*\<reference path=".*"\s*\/\>\s*\n/ig, "");
			contents += "declare module \"updraft\" {\n" +
									"	export = Updraft;\n" +
									"}\n";
			return contents;
		}));
	
	dts = tsResult.dts.pipe(gulp.dest("./"));
	
	var js = tsResult.js;
	
	js = js.pipe(insert.transform(function(contents: string, file: any) {
		contents = contents.replace(/(Updraft = {})/g, "/* istanbul ignore next */ $1");
		contents = contents.replace(/(var _a(,|;))/g, "/* istanbul ignore next */ $1");
		return contents;
	}));
	

	if(minify) {
		js = js.pipe(uglify());
	}
	
	js = js
		.pipe(sourcemaps.write("./"))
		.pipe(gulp.dest("./"));

	return merge([dts, js]);
});
開發者ID:arolson101,項目名稱:updraft,代碼行數:35,代碼來源:Gulpfile.ts

示例4:

gulp.task("compile:prod", ["tslint"], () => {
    let tsResult = gulp.src("src/**/*.ts")
        .pipe(tsc(tsProject));
    return tsResult.js
        .pipe(uglify())
        .pipe(gulp.dest("dist"));
});
開發者ID:nestis,項目名稱:widgetFrontAngular2,代碼行數:7,代碼來源:gulpfile.ts

示例5:

gulp.task('task:worker:minify', () => gulp
  .src([
    'dist/worker.js'
  ], {base: 'dist'})
  .pipe(uglify())
  .pipe(rename({suffix: '.min'}))
  .pipe(gulp.dest('dist')));
開發者ID:iller7,項目名稱:mobile-toolkit-ng,代碼行數:7,代碼來源:gulpfile.ts

示例6:

gulp.task('task:bundles:minify', () => gulp
  .src([
    'tmp/es5/bundles/**/*.js'
  ])
  .pipe(uglify())
  .pipe(rename({suffix: '.min'}))
  .pipe(gulp.dest('tmp/es5/bundles')));
開發者ID:webmaxru,項目名稱:mobile-toolkit,代碼行數:7,代碼來源:gulpfile.ts

示例7:

 const tasks = [paths.coffee.bokehjs, paths.coffee.api, paths.coffee.widgets, paths.coffee.gl].map((entry) => {
   return gulp.src(entry.destination.fullWithPath)
     .pipe(rename((path) => path.basename += '.min'))
     .pipe(uglify({ output: {comments: /^!|copyright|license|\(c\)/i} }))
     .pipe(insert.append(license))
     .pipe(sourcemaps.write('./'))
     .pipe(gulp.dest(paths.buildDir.js))
 })
開發者ID:bgyarfas,項目名稱:bokeh,代碼行數:8,代碼來源:scripts.ts

示例8: uglify

    () => {

        return gulp.src(config.bootstrapSource)
            .pipe(concat('bootstrap.js.dist'))
            .pipe(gulpif(minify, uglify()))
            .pipe(gulp.dest(APP_DIR + '/Resources/container-lib'));

    }
開發者ID:lindsaymacvean,項目名稱:seventag,代碼行數:8,代碼來源:Gulpfile.ts


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