本文整理匯總了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();