Gulp plugin for replace strings in one pipe in files.
$ npm i gulp-replaces -D
# or
$ yarn add gulp-replaces -D
// gulpfile.js
const gulp = require('gulp');
const replaces = require('gulp-replaces');
gulp.task('default', () => {
return gulp
.src('./src/main.js')
.pipe(replaces({
'process.env.NODE_ENV': JSON.stringify('development'),
'process.env.PORT': 3000,
}))
.pipe(gulp.dest('./dist'));
});