当前位置: 首页>>代码示例>>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;未经允许,请勿转载。