I am using JSPM to build a React application. While bundling the solution during build, I'd like to "envify" the entire solution (my codebase plus any libs such as React) using something like NODE_ENV=production jspm bundle ./src/main ./dist/main.min.js --minify
. I have tried dozens of different approaches but not seem to be work with the entire codebase.
Asked
Active
Viewed 219 times
5

Gerson Goulart
- 584
- 6
- 14
-
What does "envify" mean? – Pointy Aug 22 '15 at 00:05
-
1Envify is the name of a browserify plugin that inlines environment variables for dead code removal during minification (in other words, it transforms code like `if (process.env.NODE_ENV !== 'production') {}` into something like `if ('development' !== 'production') {}` so minifiers such as UglifyJS can identify this code as unreachable and remove it from the minified script. – Gerson Goulart Aug 22 '15 at 00:11
-
2I ended up getting around the problem using Gulp and the excellent plugin gulp-envify - not the solution I was hoping for, but... – Gerson Goulart Apr 13 '16 at 23:07