• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript gulp-sourcemaps.init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript gulp-sourcemaps.write函数代码示例发布时间:2022-05-25
下一篇:
TypeScript gulp-shell.task函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap