diff --git a/package-lock.json b/package-lock.json index 48e889d2..6d6dec0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "bitfield": "^3.0.0", "cheerio": "^1.0.0-rc.10", "compare-versions": "^3.6.0", + "create-torrent": "3.33.0", "debug": "^4.3.1", "detect-onebyte-encoding": "^1.0.3", "electron-context-menu": "^3.1.1", diff --git a/package.json b/package.json index 1f2daa82..c91d42e7 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,8 @@ "react-plotly.js": "^2.5.1", "simple-encryptor": "github:DEgITx/node-simple-encryptor", "stun": "1.1.0", - "webtorrent": "github:DEgITx/webtorrent" + "webtorrent": "github:DEgITx/webtorrent", + "create-torrent": "3.33.0" }, "devDependencies": { "@babel/core": "^7.14.3", diff --git a/src/app/header.js b/src/app/header.js index 114ceccf..91f27aa7 100644 --- a/src/app/header.js +++ b/src/app/header.js @@ -6,7 +6,9 @@ import Search from './search' import Tooltip from './tooltip' import ContextMenu from './context-menu' -import createTorrent from 'create-torrent'; +let createTorrent; +if(typeof WEB === 'undefined') + createTorrent = require('create-torrent') import fs from 'fs' let dialog if(typeof WEB === 'undefined')