本文整理汇总了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("."));
});
示例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)),
]);
});
示例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)),
])
})
示例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)));
}
示例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("."));
});
示例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());
});
示例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));
});
示例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));
});