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


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

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


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

示例1:

 const streams = entriesAndSources.map(({ entry, name, sources }: IEntry): any =>
     settings.gulp
         .src(sources)
         .pipe(sourcemaps.init())
         .pipe(webpack({
             entry,
             externals,
             output: {
                 library: name,
                 libraryTarget: "amd"
             }
         }))
         .pipe(rename(`${name}.js`))
         .pipe(uglify())
         .pipe(sourcemaps.write("."))
         .pipe(settings.gulp.dest(Constants.folders.dist)));
開發者ID:FullScreenShenanigans,項目名稱:gulp-shenanigans,代碼行數:16,代碼來源:webpack.ts

示例2: buildTypeScript

function buildTypeScript() {
  typescriptCompiler = ts.createProject('tsconfig.json', {
    "typescript": require('typescript')
  });

  let dts = gulp.src(project.transpiler.dtsSource);

  let src = gulp.src(project.transpiler.source)
    .pipe(changedInPlace({firstPass: true}));

  return eventStream.merge(dts, src)
    .pipe(plumber({ errorHandler: notify.onError('Error: <%= error.message %>') }))
    .pipe(sourcemaps.init())
    .pipe(typescriptCompiler())
    .pipe(build.bundle());
}
開發者ID:fedoranimus,項目名稱:aurelia-gojs,代碼行數:16,代碼來源:transpile.ts

示例3: getCompilerSettings

gulp.task(generateLocalizedDiagnosticMessagesJs, /*help*/ false, [], () => {
    const settings: tsc.Settings = getCompilerSettings({
        target: "es5",
        declaration: false,
        removeComments: true,
        noResolve: false,
        stripInternal: false,
        types: ["node", "xml2js"]
    }, /*useBuiltCompiler*/ false);
    return gulp.src(generateLocalizedDiagnosticMessagesTs)
        .pipe(newer(generateLocalizedDiagnosticMessagesJs))
        .pipe(sourcemaps.init())
        .pipe(tsc(settings))
        .pipe(sourcemaps.write("."))
        .pipe(gulp.dest(scriptsDirectory));
});
開發者ID:sinclairzx81,項目名稱:TypeScript,代碼行數:16,代碼來源:Gulpfile.ts

示例4: getCompilerSettings

gulp.task(processDiagnosticMessagesJs, false, [], () => {
    const settings: tsc.Settings = getCompilerSettings({
        target: "es5",
        declaration: false,
        removeComments: true,
        noResolve: false,
        stripInternal: false,
        outFile: processDiagnosticMessagesJs
    }, /*useBuiltCompiler*/ false);
    return gulp.src(processDiagnosticMessagesTs)
        .pipe(newer(processDiagnosticMessagesJs))
        .pipe(sourcemaps.init())
        .pipe(tsc(settings))
        .pipe(sourcemaps.write("."))
        .pipe(gulp.dest("."));
});
開發者ID:garthk,項目名稱:TypeScript,代碼行數:16,代碼來源:Gulpfile.ts

示例5:

gulp.task("build.css", ["build.css.dev"], () => {
    return gulp.src(["src/themes/*.scss"])
        .pipe(plumber())
        .pipe(sourcemaps.init())
        .pipe(sass({
            includePaths: ["src/**/*.scss"],
        }))
        .pipe(autoprefixer({
            browsers: ["last 2 versions"],
            cascade: false
        }))
        .pipe(cleanCSS())
        .pipe(sourcemaps.write())
        .pipe(plumber.stop())
        .pipe(gulp.dest("./dist"));
});
開發者ID:damyanpetev,項目名稱:zero-blocks,代碼行數:16,代碼來源:gulpfile.ts

示例6: 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(`${gutil.colors.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
  return gulp.src(`${tree_ts}/**/*.ts`)
    .pipe(sourcemaps.init())
    .pipe(ts(tsconfig.compilerOptions, ts.reporter.nullReporter()).on('error', error))
    .pipe(sourcemaps.write("."))
    .pipe(gulp.dest(paths.build_dir.tree_js))
})
開發者ID:alamont,項目名稱:bokeh,代碼行數:47,代碼來源:scripts.ts

示例7: getCompilerSettings

gulp.task("browserify", "Runs browserify on run.js to produce a file suitable for running tests in the browser", [servicesFile], (done) => {
    const testProject = tsc.createProject("src/harness/tsconfig.json", getCompilerSettings({ outFile: "built/local/bundle.js" }, /*useBuiltCompiler*/ true));
    return testProject.src()
        .pipe(newer("built/local/bundle.js"))
        .pipe(sourcemaps.init())
        .pipe(tsc(testProject))
        .pipe(through2.obj((file, enc, next) => {
            browserify(intoStream(file.contents))
                .bundle((err, res) => {
                    // assumes file.contents is a Buffer
                    file.contents = res;
                    next(undefined, file);
                });
        }))
        .pipe(sourcemaps.write(".", { includeContent: false, sourceRoot: "../../" }))
        .pipe(gulp.dest("."));
});
開發者ID:Manishjoshi31,項目名稱:TypeScript,代碼行數:17,代碼來源:Gulpfile.ts

示例8: ts

 @Task('ts')
 ts() {
     return gulp.src(['app/ts/**/*.ts', '!app/ts/**/*.spec.ts'])
         .pipe(sourcemaps.init())
         .pipe(ts({
             noImplicitAny: false,
             target: 'ES5',
             module: 'commonjs',
             removeComments: true
         }))
         .pipe(concat('main.js'))
         .pipe(sourcemaps.write('./'))
         .pipe(gulp.dest('./app/js'))
         .pipe(browserSync.reload({
             stream: true
         }));
 }
開發者ID:pgalias,項目名稱:hexagon,代碼行數:17,代碼來源:gulpclass.ts

示例9: build

function build(
	buildDir: string,
	minifyScripts: boolean,
	bundleScripts: boolean,
	embedSourceMap: boolean,
	separateBuildDir: boolean
): Promise<void> {

	return sourceMapUtil.waitForStreamEnd(
		gulp.src(path.join(buildDir, separateBuildDir ? '../src/*.js' : '*.js'))
		.pipe(sourcemaps.init())
		.pipe(minifyScripts ? uglify({ mangle: false, compress: { sequences: false } }) : nop())
		.pipe(bundleScripts ? concat('bundle.js') : rename((path) => { path.basename += '.min'; }))
		.pipe(mapSources((srcPath) => separateBuildDir ? '../src/' + srcPath : srcPath))
		.pipe(sourcemaps.write(embedSourceMap ? undefined : '.', { includeContent: false }))
		.pipe(gulp.dest(buildDir)));
}
開發者ID:hbenl,項目名稱:vscode-firefox-debug,代碼行數:17,代碼來源:testGulpSourceMaps.ts


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