1.0.1 • Published 8 years ago

gulp-env-change v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

gulp-env-change

Change NODE_ENV in a gulp chain

why?

To change NODE_ENV for specific tasks in your build chain.

If using a single image for deployment over dev/staging/prod, building with NODE_ENV='production' might not be an acceptable solution, this plugin allows you switch NODE_ENV for specific tasks (such as minifying+uglifying a production version without requiring a separate build).

installation

$ npm install --save-dev gulp-env-change

#usage

import envChange from 'gulp-env-change';

gulp.task('foo', () => {
  return gulp.src('./src/*.js')
    .pipe(envChange({environment: 'production'}) // switch NODE_ENV to production for uglify
      .pipe(rename({suffix: '.min'})
      .pipe(uglifyjs())
    .pipe(envChange({environment: 'reset'}) // switch NODE_ENV back to previous setting
    .pipe(gulp.dest('./target/'))
});
1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago