juliangruber / balanced-match

Match balanced character pairs, like { and }
MIT License
125 stars 40 forks source link

Add separate ES5 & ES6 builds & update package.json #32

Open jhildenbiddle opened 3 years ago

jhildenbiddle commented 3 years ago

As of v2.0.0, many projects will inadvertently bundle ES6 source from balanced-match in their ES5 bundles. This is a result of 1) balanced-match v2.0.0 being written in ES6 but not offering a separate ES5 version as well, and 2) most build processes being configured to ignore files in the node_modules folder when transpiring to ES5 (e.g. babel).

To address this issue, this library should offer ES5 and ES6 versions (minified and unminified) to accommodate all JavaScript environments. This will allow projects to use balanced-match without having to worry about transpilation to ES5. The build process would be trivial (compared to larger apps / libraries) and would likely prevent a lot of frustration.

Happy to create a PR with proposed changes.

Thanks!