diff --git a/node/src/workerChannel/src/index.ts b/node/src/workerChannel/src/index.ts index 3edbc178f5..f894f8992a 100644 --- a/node/src/workerChannel/src/index.ts +++ b/node/src/workerChannel/src/index.ts @@ -3,9 +3,14 @@ import { EnhancedEventEmitter } from '../../enhancedEvents'; const buildType = process.env.MEDIASOUP_BUILDTYPE ?? 'Release'; +/** + * NOTE: The following path is reachable from: + * - current file: node/src/workerChannel/src/index.ts + * - transpiled JS file: node/lib/workerChannel/src/index.js + */ // eslint-disable-next-line @typescript-eslint/no-var-requires const { WorkerChannel: NativeWorkerChannel } = require( - `../build/${buildType}/worker-channel.node` + `../../../src/workerChannel/build/${buildType}/worker-channel.node` ); export type WorkerChannelEvents = { diff --git a/npm-scripts.mjs b/npm-scripts.mjs index 1c1fd22f44..9daac3348c 100644 --- a/npm-scripts.mjs +++ b/npm-scripts.mjs @@ -329,8 +329,6 @@ function buildTypescript({ force = false } = { force: false }) { deleteNodeLib(); executeCmd('tsc --project node'); - - copyAddon(); } function buildWorkerLib() { @@ -349,21 +347,6 @@ function buildAddon() { executeCmd( `cd ${WORKER_CHANNEL_ADDON_PATH} && node scripts.mjs binding:build` ); - - copyAddon(); -} - -function copyAddon() { - logInfo('copyAddon()'); - - const buildType = process.env.MEDIASOUP_BUILDTYPE || 'Release'; - const outDir = `node/lib/workerChannel/build/${buildType}`; - - ensureDir(outDir); - - fs.cpSync(`${WORKER_CHANNEL_ADDON_PATH}/build/${buildType}`, outDir, { - recursive: true, - }); } function cleanWorkerArtifacts() {