本文整理汇总了TypeScript中gulp-typescript.reporter.fullReporter方法的典型用法代码示例。如果您正苦于以下问题:TypeScript reporter.fullReporter方法的具体用法?TypeScript reporter.fullReporter怎么用?TypeScript reporter.fullReporter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gulp-typescript.reporter
的用法示例。
在下文中一共展示了reporter.fullReporter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: compile
export function compile({
declarations = false,
tsProjectOptions = {},
tsProject,
compilePaths = getCompilePaths(),
outputDir = '.',
definitionsDir = 'definitions',
reporter = tsReporter.fullReporter(true)
}: {
declarations?: boolean;
tsProjectOptions?: any;
tsProject?: any,
compilePaths?: Array<string>;
outputDir?: string;
definitionsDir?: string;
reporter?: any;
}) {
log('------------------------------------------');
log('===> Starting typescript compilation...');
log('------------------------------------------');
const startTime = new Date();
const tsProjectToUse = tsProject || createTsProjectFromOptions({
tsProjectOptions,
declarations
});
const tsResult = src(compilePaths, {base: "."})
.pipe(sourcemaps.init())
.pipe(tsProjectToUse(reporter) as any);
const jsFiles = tsResult.js
.pipe(sourcemaps.write())
.pipe(dest(outputDir))
.on('error', (err) => {
log('------------------------------------------');
log('<=== Failed to compile sources. ' + err.stack);
log('------------------------------------------');
})
.on('end', () => {
const compilationTime = Math.round((new Date().getTime() - startTime.getTime()) / 1000 * 100) / 100;
log('------------------------------------------');
log(`<=== Typescript source compiling finished in ${compilationTime} sec.`);
log('------------------------------------------');
});
const dtsFiles = tsResult.dts.pipe(
dest(join(outputDir, definitionsDir))
);
return merge([jsFiles, dtsFiles]) as any;
}