Skip to content

Commit

Permalink
Fixed: You are currently using minified code outside of NODE_ENV === …
Browse files Browse the repository at this point in the history
…'production'
  • Loading branch information
LenaBarinova committed Feb 20, 2016
1 parent 5dd887e commit 3f44166
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions gulpfile.js
Expand Up @@ -7,18 +7,24 @@ var babel = require('babel-core/register');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var del = require('del');
var envify = require('loose-envify/custom');

gulp.task('build', ['copy-files'], function () {
return browserify({
extensions: ['.jsx', '.js'],
entries: './src/app.jsx',
})
.transform(babelify.configure({ ignore: /(node_modules)/ }))
})
.transform(babelify.configure({
ignore: /(node_modules)/
}))
.transform(
envify({
_: 'purge', NODE_ENV: 'production'
}), { global: true })
.bundle()
.on("error", function (err) { console.log("Error : " + err.message); })
.pipe(source('app.js'))
.pipe(buffer())
.pipe(plug.envify(['production']))
.pipe(plug.uglify())
.pipe(gulp.dest('./dist/'));
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -32,11 +32,11 @@
"chai": "^3.4.1",
"del": "^2.1.0",
"gulp": "^3.9.0",
"gulp-envify": "^1.0.0",
"gulp-load-plugins": "^1.1.0",
"gulp-mocha": "^2.2.0",
"gulp-uglify": "^1.5.1",
"lodash": "^3.10.1",
"loose-envify": "^1.1.0",
"mocha": "^2.3.4",
"react-addons-test-utils": "^0.14.3",
"react-redux": "^4.4.0",
Expand Down

0 comments on commit 3f44166

Please sign in to comment.