I'm using the envify transform and uglify to remove dead code.
.transform('envify', {
global: true,
NODE_ENV: process.argv.indexOf('--production') !== -1 ? 'production' : 'development'
})
When the NODE_ENV property is changed between runs, browserify-incremental still uses its cached version of files which produces a different output to what is expected.
Is this fixable in browserify-incremental? Otherwise, before I run browserify-incremental I need to delete the cache file when NODE_ENV changes between runs and that means storing state somewhere. 😞