Perf: lazy-load more require() calls in main process

Went from 36 unique require calls, to 31 calls after this commit.
This commit is contained in:
Feross Aboukhadijeh
2016-09-30 18:20:30 -07:00
parent 21de048738
commit d5820063a1
4 changed files with 40 additions and 18 deletions

View File

@@ -1,5 +1,4 @@
const appConfig = require('application-config')('WebTorrent')
const fs = require('fs')
const path = require('path')
const electron = require('electron')
const arch = require('arch')
@@ -146,6 +145,8 @@ function isPortable () {
return false
}
const fs = require('fs')
try {
// This line throws if the "Portable Settings" folder does not exist, and does
// nothing otherwise.