TobiasNickel / tXml

:zap:very small and fast xml-parser in pure javascript:zap:
MIT License
217 stars 28 forks source link

feat: wildcard export #25

Closed manzt closed 2 years ago

manzt commented 3 years ago

Introduced in #23, a side effect is that the "exports" restricts how txml may be imported. While package exports are a standard, they are not respected by all bundlers (specifically webpack<4), so we are unable to use txml/txml import in our source code.

This PR adds a wild-card export which permits that modules may be imported using an explicit path. For example, this currently raises an error with txml:

import { parse } from 'txml/dist/txml.mjs'; // : Package subpath './dist/txml.mjs' is not defined by "exports" 

It would be great to have a patch release with this feature because it has been causing some issues in geotiff.js! Thanks again for your work on this project. It is an excellent module!

TobiasNickel commented 2 years ago

thank you very much, I will publish that soon to npm.

TobiasNickel commented 2 years ago

thanks again, it is published as version 5.1.0