NaturalIntelligence / fast-xml-parser

Validate XML, Parse XML and Build XML rapidly without C/C++ based libraries and no callback.
https://naturalintelligence.github.io/fast-xml-parser/
MIT License
2.49k stars 302 forks source link

Output has non es5 keywords. #494

Open ItamarGronich opened 2 years ago

ItamarGronich commented 2 years ago

Description

library contains non es5 output. Seems like this library doesn't go through the build process actually before being published. Otherwise babel (which doesn't have a target or a browserslist by the way) will compile to es5 by default.

My suggested solution is to run the library through a build process using babel and add a .browserslistrc file to specify the target explicitly rather than relying on convention and preset-env's default configuration. preferably rollup which is more tailored towards libraries and has es modules export capabilities (webpack 5 has them too but it's new).

Input

None

Code

None

Output

Non es5 keywords like const exist in library output.

expected output

output should be es5 without any const, let etc...

Or, if you decide not to support older browsers, please specify so in the documentation.

Would you like to work on this issue?

Bookmark this repository for further updates.

github-actions[bot] commented 2 years ago

I'm glad you find this repository helpful. I'll try to address your issue ASAP. You can watch the repo for new changes or star it.

amitguptagwl commented 1 year ago

Last time I tried rollup, it was giving multiple issues. Hence, I selected webpack 5. But let me check what is the issue.

amitguptagwl commented 1 year ago

I've tried all the configuration along with babel. But somehow it is sill including const. Not sure why.