The atorable-loader works with your webpack build or other builds. I also built a react component that helps in using the torrents on a webpage.
Atorable resolves the targeted import/require() of a javascript file into a Webtorrent magnet uri. During the build the target file and torrent file are emitted in the build or stored externally via Atorable API (other builds). The emitted and stored files act as the seeds for the torrent.
Webpack: https://www.npmjs.com/package/atorable-loader
React: https://www.npmjs.com/package/atorable-react
Atorable: https://www.atorable.com
Cheers,
Serge