I have the following gulp task in my gulpfile.js :
gulp.task('build-scripts', function () { var b = browserify({ debug: false }); b.transform(reactify); b.transform(envify({ _: 'purge', NODE_ENV: 'production' })); b.add('./src/scripts/index.js'); return b.bundle() .pipe(source('./www/scripts/dist/bundle.js')) .pipe(buffer()) .pipe(uglify()) .pipe(gulp.dest('.')) });
The task completes with status 0 and the React conversion occurs, but in bundle.js I can still see:
if (process.env.NODE_ENV !== 'production') {
Shouldn't that have disappeared with the envify conversion? Am I something wrong here?
I did some digging, but all the solutions I can find are os x / linux specific (I'm on a windows machine).
EDIT: I am running the gulp construct from the Visual Studio Task Runner Explorer .
source share