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


TypeScript gulp-typescript类代码示例

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


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

示例1:

gulp.task("build.js", () => {
    return gulp.src(tsSources.concat("./typings/index.d.ts"), { base: "."})
        .pipe(sourcemaps.init())
        .pipe(ts(tsProject))
        .pipe(sourcemaps.write("."))
        .pipe(gulp.dest("."));
});
开发者ID:damyanpetev,项目名称:zero-blocks,代码行数:7,代码来源:gulpfile.ts

示例2: build

function build(path: string[]): Promise<any> {
  // TODO: remove this if it every works in watch mode without needing to re-create.
  let project = gulpTs.createProject('tsconfig.json', {
    typescript: require('typescript'),
    rootDir: 'modules'
  });
  let output = gulp.src(path)
    .pipe(gulpTs(project));
  // Using a promise instead of merging streams since end
  // event on streams seems not to be propagated when merged.
  return new Promise((resolve) => {
    var doneCount = 0;
    output.js
      .pipe(rename(buildUtils.stripSrcFromPath))
      .pipe(gulp.dest('dist'))
      .on('end', maybeDone),
    output.dts
      .pipe(rename(buildUtils.stripSrcFromPath))
      .pipe(gulp.dest('dist'))
      .on('end', maybeDone)

    function maybeDone() {
      doneCount++;
      if (doneCount == 2) resolve();
    }
  })

}
开发者ID:Zeniagromoff,项目名称:universal,代码行数:28,代码来源:gulpfile.ts

示例3: typescriptTask

export function typescriptTask(enableSourcemaps: boolean = false) {
  let files = [`${DIR_SRC}/**/*.ts`, 'typings/browser/**/*.d.ts'];
  return gulp.src(files, {base: DIR_SRC})
      .pipe(gulpif(enableSourcemaps, sourcemaps.init()))
      .pipe(typescript(project))
      .pipe(gulpif(enableSourcemaps, sourcemaps.write()))
      .pipe(gulp.dest(DIR_TMP));
}
开发者ID:Farata,项目名称:polymer-typescript-starter,代码行数:8,代码来源:common.ts

示例4:

	@Task('ts::compile')
	src() {
		let tsResult = this.tsProject.src()
			.pipe(ts(this.tsProject));
		return tsResult.js
			.pipe(gulp.dest('./dist'))
			.pipe(debug());
	}
开发者ID:happy-q,项目名称:happy-q-core,代码行数:8,代码来源:gulpclass.ts

示例5:

gulp.task('compile', () => {
  const tsResult = gulp.src(paths.src + '/' + paths.ts)
    .pipe(sourcemaps.init())
    .pipe(ts(tsProject));
  return tsResult.js
    .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest(paths.build));
});
开发者ID:Sacret,项目名称:redmine-charts-ng2,代码行数:8,代码来源:gulpfile.ts

示例6:

gulp.task('script', () => {
    let tsProject = tsc.createProject('tsconfig.json');
 
    return tsProject
        .src()
        .pipe(sourcemaps.init())
        .pipe(tsc(tsProject))
        .pipe(sourcemaps.write())
        .pipe(gulp.dest('dist'));
});
开发者ID:dyliew,项目名称:hapi-postgres-typescript-play,代码行数:10,代码来源:gulpfile.ts

示例7:

gulp.task('compile-typescript', () => {
  let customOpts = { module: 'system', moduleResolution: 'node' };
  let tsProject = typescript.createProject('tsconfig.json', customOpts);
  gulp
    .src(SCRIPTS_SRC)
    .pipe(changed(APP_DEST))
    .pipe(typescript(tsProject))
    .pipe(gulp.dest(APP_DEST))
    .pipe(browserSync.stream());
});
开发者ID:jlsuarezs,项目名称:Angular2TS-Starter-Kit,代码行数:10,代码来源:gulpfile.ts

示例8: merge

gulp.task("build.src", () => {

    var tsResult = gulp.src(["./typings/index.d.ts"].concat(source, specFilesNegate), { base: "./src"})
        .pipe(inlineNg2Template({ useRelativePaths: true, base: "/src/*"}))
        .pipe(sourcemaps.init())
        .pipe(ts(tsProdProject));

    return merge(
        tsResult.js.pipe(sourcemaps.write()).pipe(gulp.dest("./igniteui-js-blocks")),
        tsResult.dts.pipe(gulp.dest("./igniteui-js-blocks"))
    );
});
开发者ID:damyanpetev,项目名称:zero-blocks,代码行数:12,代码来源:gulpfile.ts

示例9: compileJs

function compileJs(src: string[], dest: string, inlineTpl?: boolean): NodeJS.ReadWriteStream {

  const result = gulp.src(['./tools/typings/tsd/tsd.d.ts', './tools/typings/*.ts'].concat(src))
    .pipe(plumber())
    .pipe(sourcemaps.init());

  return result
    .pipe(typescript(tsProject)).js
    .pipe(ngAnnotate())
    .pipe(sourcemaps.write())
    .pipe(gulp.dest(dest));
}
开发者ID:australdev,项目名称:app,代码行数:12,代码来源:gulpfile.ts

示例10: function

gulp.task('tsc', function() {
    const tsProject = ts.createProject('server.json', {
        typescript : require('typescript')
    });
    const tsResult = gulp.src(['public/javascripts/*.ts', 'routes/*.ts'])//tsProject.src() 
		.pipe(ts(tsProject))
        .pipe(gulp.dest(function(file) {
            return file.base;
  }));
        // .on('error', gutil.log);
	return tsResult;
});
开发者ID:lishinko,项目名称:change_time,代码行数:12,代码来源:gulpfile.ts


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