【发布时间】:2018-05-08 15:26:46
【问题描述】:
// Create a scss theme file
gulp.task('theme-scss', function() {
return gulp.src(['./retailer-theme.json']).on('error', gutil.log)
.pipe(replace('/.*/m', 'hello')).on('error', gutil.log)
//.pipe(jsonSass({prefix: '$theme: '})).on('error', gutil.log)
/*.pipe(rename({
dirname: './',
basename: 'retailer',
suffix: '-theme',
extname: '.scss'
})).on('error', gutil.log)*/
.pipe(gulp.dest(APP_DIR + '/scss/variables/')).on('error', gutil.log)
})
尝试用 hello.enter code here 替换文件中的所有内容
Retailer-theme.json 中的文本是文本
.pipe(replace('text', 'hello')).on('error', gutil.log)
以上行按预期工作
【问题讨论】:
标签: gulp gulp-replace