gulp-build-replace
v1.0.1
Published
Conditional replace for build version
Downloads
3
Readme
json-format
Conditional replace, for a build version.
Instaling
npm install gulp-build-replace
Usage
var gulp = require('gulp');
var buildReplace = require('gulp-build-replace');
var isBUILD = !!~process.argv.indexOf('--production');
gulp.task('default', function () {
gulp
.src('test.js')
.pipe(buildReplace(isBUILD))
.pipe(gulp.dest('./dist'))
});
Origian file
//[BUILD]
//[TRUE]
console.log('is a build version');
//[FALSE]
console.log('not a build version');
//[ENDBUILD]
Result if build is true
console.log('is a build version');
Result if build is false
console.log('not a build version');