Reputation: 2305
I want to automate the process of packing my extension for Chrome and Firefox and for that I'm using Gulp. I have two different manifest files, one for Chrome and one for Firefox (manifest.json
and manifestff.json
) in the root directory of the project. Now, I want to:
manifestff.json
into manifest.json
in the process.Here is my current task for packing extension for Firefox:
gulp.task('pack-firefox', () => {
return gulp.src([
'manifestff.json',
'index.html',
'./public/**'
], {'base': '.'})
.pipe(gulp.dest('./ff'));
}
Is it possible to specify (with additional .pipe()
) that I want to copy manifestff.json
as manifest.json
?
Upvotes: 0
Views: 361
Reputation: 180825
Look into gulp-if
const gulp = require('gulp');
const rename = require('gulp-rename');
const gulpIF = require('gulp-if');
gulp.task('pack-firefox', () => {
return gulp.src([
'manifestff.json',
'index.html',
'./public/**'
], { 'base': '.' })
.pipe(gulpIF(function (file) { return file.path.match('manifestff.json') }, rename('manifest.json')))
.pipe(gulp.dest('./ff'));
});
Upvotes: 1