hughsk / envify

:wrench: Selectively replace Node-style environment variables with plain strings.
901 stars 57 forks source link

Port to acorn-node for modern syntax support #62

Closed goto-bus-stop closed 2 years ago

goto-bus-stop commented 5 years ago

This patch moves from esprima to acorn-node, which has support for many new JS syntax features. It aims to keep up parity with Node.js. For example, async functions and object rest spread now work.

I've mostly kept the old logic intact, comparing nodes with === doesn't work in acorn so I've added an equalNodes function that I think covers all necessary bases.

Note this does not add support for destructuring process.env yet (eg #58), it just prevents envify from erroring out on files that contain new syntax features.

Fixes https://github.com/browserify/tinyify/issues/18

niftylettuce commented 5 years ago

Amazing. 👏

niftylettuce commented 5 years ago

Can this be merged? Ping @goto-bus-stop @hughsk

goto-bus-stop commented 2 years ago

Applied in https://github.com/browserify/envify