slue-envify
Replace process.env variables in your script and then parse the result code. Support es6.
Usage
For example, there is a file named main.js
const fs = ; if processenvNODE_ENV === 'production' var vars1 = 10; else var vars = 20; if processenvNODE_ENV_R === 'production' && flag console; else console;
run this script:
const slueFs = ;const slueStream = ;const slueEnvify = ; const envs = NODE_ENV: 'development' NODE_ENV_R: 'production';slueFs ;
the output is:
"use strict"; var vars1 fs = vars = 20; flag ? console : console;