所以這是我的任務:反應告訴我,我在開發中使用精縮...
gulp.task('prod', function() {
browserify({entries: [
'resources/assets/js/app.js'
]})
.transform("babelify")
.transform(envify({
NODE_ENV: 'production'
}))
.bundle()
.pipe(source('all.js'))
.pipe(buffer())
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(uglify())
.on('error', gutil.log)
.pipe(gulp.dest('public/js/'));
});
但控制檯依然最高審計機關:
all.js:30 Warning: It looks like you're using a minified copy of the development build of React. When deploying React apps to production, make sure to use the production build which skips development warnings and is faster. See [url here that stack doesn't like] for more details.
所以我很困惑。這是怎麼回事?
它可能是陌生的,但你可以嘗試更換'NODE_ENV:「production''到'NODE_ENV:JSON.stringify(」生產「)'? –