EventEmitterOptions {
/**
* The type of async event.
- * @default new.target.name
+ * @default new.target.name if instantiated from a child class.
*/
name?: string
}
* @since v17.4.0, v16.14.0
*/
export class EventEmitterAsyncResource extends EventEmitter {
- constructor (options?: EventEmitterAsyncResourceOptions)
+ constructor (options: EventEmitterAsyncResourceOptions)
/**
* Call all `destroy` hooks. This should only ever be called once. An error will
* be thrown if it is called more than once. This **must** be manually called. If
"benchmark": "pnpm build && node -r source-map-support/register benchmarks/internal/bench.mjs",
"benchmark:debug": "pnpm build && node -r source-map-support/register --inspect benchmarks/internal/bench.mjs",
"benchmark:prod": "pnpm build:prod && node benchmarks/internal/bench.mjs",
- "test": "pnpm build && c8 mocha 'tests/**/*.test.js'",
+ "test": "pnpm build --environment SOURCEMAP:false && c8 mocha 'tests/**/*.test.js'",
"test:debug": "pnpm build && mocha --no-parallel --inspect 'tests/**/*.test.js'",
"coverage": "c8 report --reporter=lcov",
"coverage:html": "c8 report --reporter=html",
const isDevelopmentBuild = env.BUILD === 'development'
const isAnalyzeBuild = env.ANALYZE
const isDocumentationBuild = env.DOCUMENTATION
+const sourcemap = env.SOURCEMAP !== 'false'
const maxWorkers = Math.floor(availableParallelism() / 2)
format: 'cjs',
...(isDevelopmentBuild && {
dir: './lib',
- sourcemap: true,
preserveModules: true,
preserveModulesRoot: './src'
}),
...(!isDevelopmentBuild && {
file: './lib/index.js',
- sourcemap: true,
plugins: [terser({ maxWorkers })]
+ }),
+ ...(sourcemap && {
+ sourcemap
})
},
{
format: 'esm',
...(isDevelopmentBuild && {
dir: './lib',
- sourcemap: true,
entryFileNames: '[name].mjs',
chunkFileNames: '[name]-[hash].mjs',
preserveModules: true,
}),
...(!isDevelopmentBuild && {
file: './lib/index.mjs',
- sourcemap: true,
plugins: [terser({ maxWorkers })]
+ }),
+ ...(sourcemap && {
+ sourcemap
})
}
],