X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.mjs;h=b1197e910e1cc524ab56265fd436579dbee6914f;hb=710826bc287a006d90f9cdda42fdbac655757973;hp=e1bdac21fe03b621fa5b4e81d2c73b3e2ef5be52;hpb=ce68dd225a5625b4a2d3c651659f33b7731736b5;p=poolifier.git diff --git a/rollup.config.mjs b/rollup.config.mjs index e1bdac21..b1197e91 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -10,14 +10,31 @@ const isDocumentation = process.env.DOCUMENTATION export default { input: 'src/index.ts', - output: { - ...(isDevelopmentBuild ? { dir: 'lib' } : { file: 'lib/index.js' }), - format: 'cjs', - sourcemap: !!isDevelopmentBuild, - ...(isDevelopmentBuild && { preserveModules: true }), - ...(isDevelopmentBuild && { preserveModulesRoot: 'src' }), - ...(!isDevelopmentBuild && { plugins: [terser({ maxWorkers: 2 })] }) - }, + strictDeprecations: true, + output: [ + { + ...(isDevelopmentBuild ? { dir: 'lib' } : { file: 'lib/index.js' }), + format: 'cjs', + sourcemap: !!isDevelopmentBuild, + ...(isDevelopmentBuild && { + preserveModules: true, + preserveModulesRoot: 'src' + }), + ...(!isDevelopmentBuild && { plugins: [terser({ maxWorkers: 2 })] }) + }, + { + ...(isDevelopmentBuild ? { dir: 'lib' } : { file: 'lib/index.mjs' }), + format: 'esm', + sourcemap: !!isDevelopmentBuild, + + ...(isDevelopmentBuild && { + entryFileNames: '[name].mjs', + preserveModules: true, + preserveModulesRoot: 'src' + }), + ...(!isDevelopmentBuild && { plugins: [terser({ maxWorkers: 2 })] }) + } + ], external: ['async_hooks', 'cluster', 'events', 'os', 'worker_threads'], plugins: [ typescript({