Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upsupport for webpack #347
support for webpack #347
Comments
This comment has been minimized.
This comment has been minimized.
|
I prefer browserify and don't have experience with webpack. That said, you should look into getting webpack to support the "browser" field in package.json. It's an ad-hoc standard. WebTorrent uses this field to tell packaging tools to ignore or replace certain modules when packaging for the browser. Obviously Here's an issue discussing how to get webpack to behave correctly: webpack/webpack#151 |
This comment has been minimized.
This comment has been minimized.
|
As far as I can tell, this issue can be resolved by following the instructions to enable the "browser" field in webpack that are described here: webpack/webpack#151 (comment) so I'm going to close this issue. If this is not the case, feel free to open a new issue or comment here and I'll re-open this issue. |
This comment has been minimized.
This comment has been minimized.
|
@ericwooley Did you manage to make it work with webpack in the end? |
This comment has been minimized.
This comment has been minimized.
|
@Paraknight I ended up importing the prebuilt version, which webpack can do fine, but it spits out a warning at you. Something along the lines of:
|
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
@chovy Can you see if |
This comment has been minimized.
This comment has been minimized.
|
Has anyone got this to work? For libsodium the fix was to add "browser": { "fs": false }, into package.json, but that doesnt work for webtorrent and the documentation linked to above is unclear to me whether there is a fix needed to webtorrent, or to the webpack config or somewhere else. and what that fix is. |
This comment has been minimized.
This comment has been minimized.
|
@mitra42 Yes, WebTorrent works in our webpack setup. Check the configuration: https://github.com/Chocobozzz/PeerTube/blob/develop/client/webpack/webpack.video-embed.js You need to set 'empty' to fs in the webpack config: https://github.com/Chocobozzz/PeerTube/blob/develop/client/webpack/webpack.video-embed.js#L141 |
This comment has been minimized.
This comment has been minimized.
|
Thanks - looks like that did it, I was following some other docs which suggested you wanted.
in the module itself. I was interpreting "node" to mean compile for node, not fake something to look like node :-) |
I can't get this going for the life of me in webpack. It keeps trying to load in fs, and something called dgram. I had to resort to importing the prebuilt minified version, which is not ideal.
Here is my webpack config