Skip to content

Commit a6b5cc8

Browse files
committed
Enables NODE_ENV variables
1 parent 087bce5 commit a6b5cc8

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ from scratch in a C9 environment, with a 'blank' template.
203203
23. npm install --save-dev jest-cli
204204
24. npm install --save-dev enzyme
205205
25. npm install --save-dev enzyme-adapter-react-16
206+
26. npm install --save-dev envify
206207

207208
### References
208209
* [Gettin started with React](https://reactjs.org/docs/add-react-to-an-existing-app.html#installing-react)

gulpfile.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ function bundle(cb) {
3939

4040
var watcher = watchify(browserify({
4141
entries: [path.ENTRY_POINT],
42-
transform: [babelify],
42+
transform: [
43+
[babelify],
44+
['envify', { NODE_ENV: 'development' }]
45+
],
4346
debug: true,
4447
cache: {},
4548
packageCache: {},
@@ -151,7 +154,10 @@ gulp.task('build', function(cb) {
151154
pump([
152155
browserify({
153156
entries: [path.ENTRY_POINT],
154-
transform: [babelify]
157+
transform: [
158+
[babelify],
159+
['envify', { NODE_ENV: 'production' }]
160+
]
155161
}).bundle(),
156162
source(path.MINIFIED_OUT),
157163
streamify(uglify(path.MINIFIED_OUT)),

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"babelify": "^8.0.0",
1616
"browser-sync": "^2.23.5",
1717
"browserify": "^15.2.0",
18+
"envify": "^4.1.0",
1819
"enzyme": "^3.3.0",
1920
"enzyme-adapter-react-16": "^1.1.1",
2021
"gulp": "^3.9.1",

0 commit comments

Comments
 (0)