當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。