Skip to content

Commit ee81429

Browse files
authored
refactor: change dynamic import to work with bundlers (#1905)
1 parent 2080b1f commit ee81429

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if (require.cache.__NR_cache) {
4040
}
4141

4242
function initApi({ agent, apiPath }) {
43-
const API = require(apiPath)
43+
const API = require(`./${apiPath}`)
4444

4545
const api = new API(agent)
4646
require.cache.__NR_cache = module.exports = api
@@ -115,7 +115,7 @@ function initialize() {
115115
/* eslint-enable no-console */
116116
}
117117

118-
const api = agent ? initApi({ agent, apiPath: './api' }) : initApi({ apiPath: './stub_api' })
118+
const api = agent ? initApi({ agent, apiPath: 'api' }) : initApi({ apiPath: 'stub_api' })
119119

120120
// If we loaded an agent, record a startup time for the agent.
121121
// NOTE: Metrics are recorded in seconds, so divide the value by 1000.

0 commit comments

Comments
 (0)