...(!isDevelopmentBuild && { plugins: [terser({ maxWorkers: 2 })] })
}
],
- external: ['async_hooks', 'cluster', 'events', 'os', 'worker_threads'],
+ external: [
+ 'node:async_hooks',
+ 'node:cluster',
+ 'node:crypto',
+ 'node:events',
+ 'node:os',
+ 'node:worker_threads'
+ ],
plugins: [
typescript({
tsconfig: isDevelopmentBuild
+import crypto from 'node:crypto'
import type {
MessageValue,
PromiseWorkerResponseWrapper
-import type { ClusterSettings, Worker } from 'cluster'
-import cluster from 'cluster'
+import type { ClusterSettings, Worker } from 'node:cluster'
+import cluster from 'node:cluster'
import type { MessageValue } from '../../utility-types'
import { AbstractPool } from '../abstract-pool'
import type { PoolOptions } from '../pool'
-import EventEmitter from 'events'
+import EventEmitter from 'node:events'
import type {
ErrorHandler,
ExitHandler,
-import { cpus } from 'os'
+import { cpus } from 'node:os'
import type { IPoolInternal } from '../pool-internal'
import type { IPoolWorker } from '../pool-worker'
import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy'
-import { isMainThread, MessageChannel, SHARE_ENV, Worker } from 'worker_threads'
+import {
+ isMainThread,
+ MessageChannel,
+ SHARE_ENV,
+ Worker
+} from 'node:worker_threads'
import type { Draft, MessageValue } from '../../utility-types'
import { AbstractPool } from '../abstract-pool'
import type { PoolOptions } from '../pool'
-import type { Worker as ClusterWorker } from 'cluster'
-import type { MessagePort } from 'worker_threads'
+import type { Worker as ClusterWorker } from 'node:cluster'
+import type { MessagePort } from 'node:worker_threads'
import type { IPoolWorker } from './pools/pool-worker'
import type { KillBehavior } from './worker/worker-options'
-import { AsyncResource } from 'async_hooks'
-import type { Worker } from 'cluster'
-import type { MessagePort } from 'worker_threads'
+import { AsyncResource } from 'node:async_hooks'
+import type { Worker } from 'node:cluster'
+import type { MessagePort } from 'node:worker_threads'
import type { MessageValue } from '../utility-types'
import { EMPTY_FUNCTION } from '../utils'
import {
-import type { Worker } from 'cluster'
-import cluster from 'cluster'
+import type { Worker } from 'node:cluster'
+import cluster from 'node:cluster'
import type { MessageValue } from '../utility-types'
import { AbstractWorker } from './abstract-worker'
import type { WorkerOptions } from './worker-options'
-import type { MessagePort } from 'worker_threads'
-import { isMainThread, parentPort } from 'worker_threads'
+import type { MessagePort } from 'node:worker_threads'
+import { isMainThread, parentPort } from 'node:worker_threads'
import type { MessageValue } from '../utility-types'
import { AbstractWorker } from './abstract-worker'
import type { WorkerOptions } from './worker-options'