简体   繁体   English

gulp dest.on 不是替换时的功能

[英]gulp dest.on is not a function when replacing

I am trying to replace characters in a compiled html file.我正在尝试替换已编译的 html 文件中的字符。

function watcherpages() {
return gulp.src(['src/pages/**/*.html', '!src/pages/archive/**/*.html'])
    .pipe(panini({
        root: 'src/pages',
        layouts: 'src/layouts',
        partials: 'src/partials',
        helpers: 'src/helpers',
        data: 'src/data'
    }))
    .pipe(inky())
    .pipe(gulp.dest('watch'))
    .pipe($.replace, '&lt;', '<');

} }

but the last line of code gives me the following error但最后一行代码给了我以下错误

14:00:01] TypeError: dest.on is not a function
at Pumpify.Readable.pipe (\node_modules\readable-stream\lib\_stream_readable.js:564:8)
at watcherpages (\gulpfile.js:84:10)
at bound (domain.js:301:14)
at runBound (domain.js:314:12)
at asyncRunner (\node_modules\async-done\index.js:55:18)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)

In the line below you are missing some parentheses:在下面的行中,您缺少一些括号:

.pipe($.replace, '&lt;', '<');  

should be应该

.pipe($.replace( '&lt;', '<'));

[and you will ultimately need to save these changes later in your pipeline] [并且您最终需要在以后的管道中保存这些更改]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM