I have been using the gulp-remove-code plugin to remove the specific code from the source files, when I need to change the environment from staging to production or vice-versa. Most of the changed code is API keys and boolean flags. This is for JS, Python, and Yaml files.
The problem with the approach is that, I need to keep the original file at a separate place, since it removes the other environment code.
Instead of removing the code based on a variable, I want to comment or uncomment code, so that I can do an in-place gulp.dest() without having a separate file.
Is there any way to do it via 'gulp' or using the 'gulp-remove-code' plugin or any other plugin?
I use npm module config for that purposes.
All you have to do is:
NODE_ENV env variableNODE_ENV variableNODE_CONFIG_DIR env variableThis approach is very convenient.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With