X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.mjs;h=26739f65d88ca4d12f75c24425ac19ef3dedcbda;hb=00dcd87e38e6aff7bd232bbbd464f91c6442aad7;hp=23d260d05ee6af1dc374dbfb98007c851dc13479;hpb=5388ef55be46ad29697a8f2f540bb732868c503b;p=poolifier.git diff --git a/rollup.config.mjs b/rollup.config.mjs index 23d260d0..26739f65 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -37,11 +37,13 @@ export default defineConfig([ format: 'cjs', ...(isDevelopmentBuild && { dir: './lib', + entryFileNames: '[name].cjs', + chunkFileNames: '[name]-[hash].cjs', preserveModules: true, preserveModulesRoot: './src' }), ...(!isDevelopmentBuild && { - file: './lib/index.js', + file: './lib/index.cjs', plugins: [terser({ maxWorkers })] }), ...(sourcemap && { @@ -66,16 +68,7 @@ export default defineConfig([ }) } ], - external: [ - 'node:async_hooks', - 'node:cluster', - 'node:crypto', - 'node:events', - 'node:fs', - 'node:os', - 'node:perf_hooks', - 'node:worker_threads' - ], + external: [/^node:*/], plugins: [ typescript({ tsconfig: './tsconfig.build.json', @@ -86,27 +79,21 @@ export default defineConfig([ del({ targets: ['./lib/*'] }), - isAnalyzeBuild && analyze(), - isDocumentationBuild && command('pnpm typedoc') + Boolean(isAnalyzeBuild) && analyze(), + Boolean(isDocumentationBuild) && command('pnpm typedoc') ] }, { input: './lib/dts/index.d.ts', output: [{ format: 'esm', file: './lib/index.d.ts' }], - external: [ - 'node:async_hooks', - 'node:cluster', - 'node:events', - 'node:perf_hooks', - 'node:worker_threads' - ], + external: [/^node:*/], plugins: [ dts(), del({ targets: ['./lib/dts'], hook: 'buildEnd' }), - isAnalyzeBuild && analyze() + Boolean(isAnalyzeBuild) && analyze() ] } ])