babel / minify

:scissors: An ES6+ aware minifier based on the Babel toolchain (beta)
https://babeljs.io/repl
MIT License
4.39k stars 225 forks source link

babel-plugin-transform-inline-environment-variables does not support destructuring #985

Open eliw00d opened 4 years ago

eliw00d commented 4 years ago

Is your feature request related to a problem? Please describe. Does not work:

const { SOME_VAR } = process.env

Works:

const SOME_VAR = process.env.SOME_VAR

Describe the solution you'd like It would be nice if this plugin supported destructuring.

Additional context I wasn't sure why my environment variables weren't working until I saw this comment: https://github.com/babel/minify/issues/687#issuecomment-523089830