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


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

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


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

示例1: compile

function compile(isRelease: boolean) {
    var tsProject = ts.createProject({
        removeComments: true,  // Do not emit comments to output.
        //noImplicitAny: false,  // Warn on expressions and declarations with an implied 'any' type.
        //noLib: false,  // Don't include the default lib (with definitions for - Array, Date etc)
        //noEmitOnError: false,  // Do not emit outputs if any type checking errors were reported.
        //target: "ES3",  // Specify ECMAScript target version: 'ES3' (default), 'ES5' or 'ES6'.
        //module: "",  // Specify module code generation: 'commonjs' or 'amd'
        //sourceRoot: "",  // Specifies the location where debugger should locate TypeScript files instead of source locations.
        declarationFiles: false,  // Generates corresponding .d.ts files.
        noExternalResolve: false,  // Do not resolve files that are not in the input. Explanation below.
        sortOutput: true,  // Sort output files. Usefull if you want to concatenate files (see below).
    });


    var tsResult = gulp.src(srcGlob)
        .pipe(ts(tsProject, { referencedFrom: ['Application.ts'] }));

    return tsResult.js
        .pipe(concat('app.js'))
        //.pipe(ngAnnotate())
        //.pipe(gulpIf(isRelease, uglify()))
        //.pipe(uglify())
        .pipe(gulp.dest('Chokaigi2015/html/js'));
}
開發者ID:yuhki50,項目名稱:pepper-chokaigi2015,代碼行數:25,代碼來源:typescript.ts

示例2: function

gulp.task('buildServer' ,['clearBuildDir'], function () {
      var typescript = require('gulp-typescript');
    var tscConfig = require('./tsconfig.json');
    var tScriptResult = gulp.src(PATHS.src)
       .pipe(typescript(tscConfig.compilerOptions));
    return tScriptResult.js.pipe(gulp.dest('build/'));
});
開發者ID:RidaRidss,項目名稱:Student_Management_System,代碼行數:7,代碼來源: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('!build:commonjs', () => gulp
  .src([
    'src/**/*.ts',
    'typings/browser/**/*.d.ts'
  ])
  .pipe(ts(commonCompilerConfig))
  .pipe(gulp.dest('dist/src')));
開發者ID:chrisjordanme,項目名稱:mobile-toolkit,代碼行數:7,代碼來源:gulpfile.ts

示例5:

gulp.task("compile", () => {
    var tsResult = gulp.src("src/**/*.ts")
        .pipe(sourcemaps.init())
        .pipe(tsc(tsProject));
    return tsResult.js
        .pipe(gulp.dest("../webapp"));
});
開發者ID:solairerove,項目名稱:blog-app,代碼行數:7,代碼來源:gulpfile.ts

示例6: function

gulp.task('compile-typescript', function () {
    var streamFinished = function () {
        gutil.log('End stream');
    };
    var entry = config.paths.app + '/main.ts';
    var fileName = path.basename(entry, path.extname(entry)) + ".js";
    return gulp.src(entry)
        .pipe(ts({
            target: "ES5",
            noImplicitAny: false,
            moduleResolution: "node",
            outFile: fileName,
            removeComments: true,
            experimentalDecorators: true
        }))
        .pipe(wrap({ src: 'template.txt' }))
        .pipe(rename({ suffix: '.debug' }))
        .pipe(gulp.dest(config.paths.pub))
        .pipe(uglify())
        .pipe(rename(fileName))
        .pipe(gulp.dest(config.paths.pub))
        .on('end', streamFinished);


    //.pipe(wrap('(function($){\n"use strict";\n<%= contents %>\n})(jQuery);'))
    //.pipe(rename(fileName))

});
開發者ID:alekspolitov,項目名稱:TypeScriptTest,代碼行數:28,代碼來源:gulpfile.ts

示例7: compilePublic

function compilePublic() {
    gulp.src(pathToPublicTs)
        .pipe(sourcemaps.init())
            .pipe(tsc(new tsconfig('system', true, true)))
        .pipe(sourcemaps.write())
        .pipe(gulp.dest('./public'));
}
開發者ID:cwadrupldijjit,項目名稱:parallax-example,代碼行數:7,代碼來源:gulpfile.ts

示例8: compileServer

function compileServer() {
    gulp.src(pathToServerTs)
        .pipe(sourcemaps.init())
            .pipe(tsc(new tsconfig('commonjs', null, null)))
        .pipe(sourcemaps.write())
        .pipe(gulp.dest('./server'));
}
開發者ID:cwadrupldijjit,項目名稱:parallax-example,代碼行數:7,代碼來源:gulpfile.ts

示例9: function

gulp.task('build-release', ['vet', 'clean-code'], function() {
    console.log('Compiling Typescript files for Release');
    return gulp
        .src(config.sourceTs)
        .pipe(tsc(config.tsc))
        .pipe(gulp.dest(config.build));
    }
開發者ID:dcaballeroc,項目名稱:unicron,代碼行數:7,代碼來源:gulpfileTypescript.ts

示例10: require

gulp.task('karma:build', () => {
  const typescript = require('gulp-typescript');
  const sourcemaps = require('gulp-sourcemaps');
  const tplinline = require('gulp-inline-ng2-template');
  const errors = require('../utils/errors');
  const paths = require('../config/paths');

  const config = {
    typescript: require('../config/typescript'),
    tplinline: require('../config/tplinline')
  };

  const tsProject = typescript.createProject(paths.typescript.appConfig, config.typescript);

  return gulp
    .src([
      paths.typings,
      paths.sources.scripts,
      '!' + paths.sources.bootstrap,
      '!' + paths.scripts.tests.e2e
    ])
    .pipe(sourcemaps.init())
      .pipe(tplinline(config.tplinline))
      .pipe(typescript(tsProject))
      .js
    .pipe(sourcemaps.write())
    .on('error', errors)
    .pipe(gulp.dest(paths.output.app));
});
開發者ID:mogusbi,項目名稱:ts-starter,代碼行數:29,代碼來源:karma.ts


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