Closed Gozala closed 5 years ago
@RangerMauve I think it actually might be reasonable to expect to request relative path from the given module for self.require
in which case it should be fine no ?
The larger question is how do I create library that depends on the node module, because there's no way for my library to make those dependencies available.
@Gozala I kinda wanted to avoid libraries that mix Node and web modules like that, honestly.
Ideally, things using Webrun will avoid using Node APIs in order to be compatible with the web, and if there's some Web APIs that are missing, they should be added to webrun core.
Ideally you should pass all your node dependencies into webrunify and build a bundle that you can then import
.
Note that not all node builtins will work with webrunify
. Because under the hood it uses Browserify, some modules are replaced with versions that only implement browser-relevant features (e.g. http
and os
) or with complete no-ops (e.g. child_process
and net
).
Not sure yet what's the best way to handle those, and whether it should be dealt with here or in webrunify
. So yeah, all ideas welcome! :)
Forking this from #16 so issue isn't derailed to this.