gimm / gulp-live-server

serve your nodejs/static app live
148 stars 71 forks source link

Cannot set environment variables #34

Closed dciccale closed 9 years ago

dciccale commented 9 years ago

hi, on version 0.0.7 i was able to set some environment variable before starting the server and it would work, but not now.

gulp.task('serve-dist', function () {
  process.env.NODE_ENV = 'production';
  g.liveServer(['./dist/server/app.js'], {}, false).start();
});

how can i handle this with the new version?

dciccale commented 9 years ago

ok, got it working. this is what i did

gulp.task('serve-dist', function () {
  var options = {env: process.env};
  options.env.NODE_ENV = 'production';
  g.liveServer(['./dist/server/app.js'], options, false).start();
});