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


TypeScript gulp-sourcemaps.write函數代碼示例

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


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

示例1: getCompilerSettings

gulp.task(instrumenterJsPath, false, [servicesFile], () => {
    const settings: tsc.Settings = getCompilerSettings({
        outFile: instrumenterJsPath
    }, /*useBuiltCompiler*/ true);
    return gulp.src(instrumenterPath)
        .pipe(newer(instrumenterJsPath))
        .pipe(sourcemaps.init())
        .pipe(tsc(settings))
        .pipe(sourcemaps.write("."))
        .pipe(gulp.dest("."));
});
開發者ID:DrewTAJ,項目名稱:wowstats,代碼行數:11,代碼來源:Gulpfile.ts

示例2: merge

  gulp.task('tsc:jasmineHelper', () => {

    var tsResult = gulp.src(env.path.jasmine.helpers)
      .pipe(sourcemaps.init())
      .pipe(ts(tsConf));

    return merge([
      tsResult.dts.pipe(gulp.dest(`${env.dir.jasmine}`)),
      tsResult.js.pipe(sourcemaps.write()).pipe(gulp.dest(env.dir.tmpJasmine)),
    ]);
  });
開發者ID:MSakamaki,項目名稱:rxjs-handson,代碼行數:11,代碼來源:typescript.ts

示例3: error

gulp.task("scripts:tsjs", ["scripts:coffee", "scripts:js", "scripts:ts"], () => {
  function error(err: {message: string}) {
    const raw = stripAnsi(err.message)
    const result = raw.match(/(.*)(\(\d+,\d+\): error TS(\d+):.*)/)

    if (result != null) {
      const [, file, rest, code] = result
      const real = path.join('src', 'coffee', ...file.split(path.sep).slice(3))
      if (fs.existsSync(real)) {
        gutil.log(`${chalk.red(real)}${rest}`)
        return
      }

      // XXX: can't enable "6133", because CS generates faulty code for closures
      if (["2307", "2688", "6053"].indexOf(code) != -1) {
        gutil.log(err.message)
        return
      }
    }

    if (!argv.ts)
      return

    if (typeof argv.ts === "string") {
      const keywords = argv.ts.split(",")
      for (let keyword of keywords) {
        let must = true
        if (keyword[0] == "^") {
          keyword = keyword.slice(1)
          must = false
        }
        const found = err.message.indexOf(keyword) != -1
        if (!((found && must) || (!found && !must)))
          return
      }
    }

    gutil.log(err.message)
  }

  const tree_ts = paths.build_dir.tree_ts
  const project = gulp
    .src(`${tree_ts}/**/*.ts`)
    .pipe(sourcemaps.init())
    .pipe(ts(tsconfig.compilerOptions, ts.reporter.nullReporter()).on('error', error))

  return merge([
    project.js
      .pipe(sourcemaps.write("."))
      .pipe(gulp.dest(paths.build_dir.tree_js)),
    project.dts
      .pipe(gulp.dest(paths.build_dir.types)),
  ])
})
開發者ID:jsalcal,項目名稱:bokeh,代碼行數:54,代碼來源:scripts.ts

示例4: compileTypeScriptFor

function compileTypeScriptFor(moduleType: string) {
  const options = project.plugin.outputs[moduleType].settings;
  const compile = createCompiler(options);

  return gulp
    .src(path.join(root, project.plugin.src, '**/*.ts'))
    .pipe(sourcemaps.init())
    .pipe(compile())
    .pipe(sourcemaps.write({ sourceRoot: project.plugin.src }))
    .pipe(gulp.dest(path.join(project.plugin.output, moduleType)));
}
開發者ID:jbockle,項目名稱:aurelia-json-schema-form,代碼行數:11,代碼來源:typescript-compilation.ts

示例5: getCompilerSettings

gulp.task(run, false, [servicesFile], () => {
    const settings: tsc.Settings = getCompilerSettings({
        outFile: run
    }, /*useBuiltCompiler*/ true);
    return gulp.src(harnessSources)
        .pipe(newer(run))
        .pipe(sourcemaps.init())
        .pipe(tsc(settings))
        .pipe(sourcemaps.write(".", { includeContent: false, sourceRoot: "../../" }))
        .pipe(gulp.dest("."));
});
開發者ID:Yanbuodiao,項目名稱:TypeScript,代碼行數:11,代碼來源:Gulpfile.ts

示例6:

export = gulp.task('development:styles', () => {
  return gulp
    .src(paths.sources.styles)
    .pipe(sourcemaps.init())
      .pipe(sass())
      .pipe(autoprefixer(config.autoprefixer))
    .pipe(sourcemaps.write())
    .pipe(gulp.dest(paths.output.styles))
    .on('error', errors)
    .pipe(browsersync.stream());
});
開發者ID:mogusbi,項目名稱:ts-starter,代碼行數:11,代碼來源:styles.ts

示例7:

 gulp.task('tsc:e2e', () => {
   return gulp.src(env.path.spec.protractor)
     .pipe(sourcemaps.init())
     .pipe(ts({
       target: 'es5',
       module: "commonjs",
       noImplicitAny: true,
       moduleResolution: 'node',
     }))
     .pipe(sourcemaps.write())
     .pipe(gulp.dest(env.dir.tmpE2e));
 });
開發者ID:MSakamaki,項目名稱:rxjs-handson,代碼行數:12,代碼來源:typescript.ts

示例8: tsProjectFn

gulp.task('build:js', 'compile *.ts files into *.js files', ['build:tslint'], () => {
  var tsProject = tsProjectFn();

  var tsResult = gulp.src(PATH.src.ts)
    .pipe(printFiles())
    .pipe(sourcemaps.init())
    .pipe(tsc(tsProject));

  return tsResult.js
    .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest(PATH.dest.base));
});
開發者ID:AdamFaron,項目名稱:FOO,代碼行數:12,代碼來源:gulpfile.ts


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