Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

perf: faster startup time #1542

Merged
merged 6 commits into from
Sep 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/core/components/libp2p.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict'

// libp2p-nodejs gets replaced by libp2p-browser when webpacked/browserified
const Node = require('../runtime/libp2p-nodejs')
const promisify = require('promisify-es6')
const get = require('lodash/get')
const defaultsDeep = require('@nodeutils/defaults-deep')
Expand Down Expand Up @@ -59,6 +57,9 @@ module.exports = function libp2p (self) {
libp2pDefaults
)

// Required inline to reduce startup time
// Note: libp2p-nodejs gets replaced by libp2p-browser when webpacked/browserified
const Node = require('../runtime/libp2p-nodejs')
return new Node(libp2pOptions)
}

Expand Down