即使我将node_env设置为生产,如何删除此React-minification?

时间:2016-06-29 17:28:04

标签: javascript node.js reactjs gulp

我是React js.的新手。我仍然得到这个即使我在我的gulp文件中将My Node env设置为production。如何删除此控制台日志。 enter image description here

gulpfile.js

var gulp = require('gulp');
var browserify = require('browserify');
var reactify = require('reactify');
var through2 =require('through2');
var concat = require('gulp-concat');
var plumber = require('gulp-plumber');
var uglify = require('gulp-uglify');
var pump = require('pump');



gulp.task('browserify',function () {
   gulp.src('./src/changenametogulpwhenditingmain.js')
       .pipe(plumber())
       .pipe(through2.obj(function (file,enc,next) {
          browserify(file.path,{'debug':true})
              .transform('reactify')
              .bundle(function (err,res) {
                 file.contents = res
                 next(null,file);
});
}))
.pipe(concat('main.js'))
    .pipe(gulp.dest('public'))
});
gulp.task('apply-prod-environment', function() {
    process.env.NODE_ENV = 'production';
});

gulp.task('default',['apply-prod-environment','browserify']);


gulp.task('watch',function () {
    gulp.watch('src/**/*.*',['default']);
});

0 个答案:

没有答案