Open lapo-luchini opened 5 years ago
+1 this caused us a lot of grief before i found this issue
+1 from me too. Trying to use this in a typescript/angular project and importing and/or requiring it is not working. I can't claim to know that much about designing javascript libraries, but it would be great if we could import this using the new ESM approach:
import {xmllint} from 'xmllint';
https://github.com/kripken/xml.js/issues/24 seems related. @kripken is this library still supported? If so, I may be willing to look into this kind of support.
I don't have time to support it myself, sorry @s4m0r4m4 :cry:
Would be great if you have time for that! I can help with emscripten questions if there are any.
Is there any progress regarding an import statement for ESM or TS? @s4m0r4m4
Sorry no, I ended up going a different direction with my project and not using this library.
@philipsens, were you able to find any workaround?
Due to the way that environments are detected it is difficult to use from Webpack, as both Node is detected (thus requiring
fs
andws
) andwindow
is detected (thus not exporting tomodule.exports
). Those issues can be worked around usingimports-loader
andexports-loader
, but it would probably be nice to have a way to detect Webpack and "just work" OOTB.I was capable of using
xmllint@0.1.1
using the following configuration: