本文整理汇总了TypeScript中gulp-util.noop函数的典型用法代码示例。如果您正苦于以下问题:TypeScript noop函数的具体用法?TypeScript noop怎么用?TypeScript noop使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了noop函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
], () =>
gulp.src([
'./assets/**/*',
'./src/client/assets/**/*',
'./src/client/app/*/assets/**/*'
])
.pipe(isProduction ? (imagemin as any)() : gutil.noop())
.pipe(rename(path => {
path.dirname = path.dirname.replace('assets', '.');
}))
.pipe(gulp.dest('./built/client/assets/'))
示例2: require
gulp.task('build:client:script', () => {
const client = require('./built/client/meta.json');
return gulp.src(['./src/client/app/boot.js', './src/client/app/safe.js'])
.pipe(replace('VERSION', JSON.stringify(client.version)))
.pipe(replace('API', JSON.stringify(config.api_url)))
.pipe(replace('ENV', JSON.stringify(env)))
.pipe(replace('LANGS', JSON.stringify(Object.keys(locales))))
.pipe(isProduction ? uglify({
toplevel: true
} as any) : gutil.noop())
.pipe(gulp.dest('./built/client/assets/'));
});
示例3: function
gulp.task('build', function() {
console.info('compiling ts')
console.time('compilation done')
var tsResult = gulp.src(tsConfig.filesGlob)
.pipe(sourcemaps.init())
.pipe(ts(tsProject))
.on('error', function(e:any){errorCount++; lastTsErrorMsg = e.message})
return merge([
tsResult.dts.pipe(gulp.dest(tsConfig.compilerOptions.outDir)),
tsResult.js.pipe(gulp.dest(tsConfig.compilerOptions.outDir)).on('end', function(){'ts compilation done'}),
tsResult.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(tsConfig.compilerOptions.outDir))
])
.pipe(util.noop())//fake pipe needed, otherwise there is no on-end event
.on('end', function(){
console.timeEnd('compilation done')
if (lastTsErrorMsg) {
notifier.notify({title: 'Server Compilation Errors (' + errorCount + ')', message: lastTsErrorMsg.replace(removeColorsReg, '')})
lastTsErrorMsg = null; errorCount = 0;
} else {
notifier.notify({title: 'Server',message:'Compilation finished'})
}
})
})
示例4: streamProvider
(streamProvider:Function):NodeJS.WritableStream =>
condition ? streamProvider() : noop();