X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.mjs;h=3d069f7f7b0f6956ec192bb40748db09bee76a1c;hb=1a74101bf2fbbc70e65eb274499073e0d945704e;hp=8f1f26562a4817d75a018129b3a09f76fd9129ab;hpb=49fb18fe8d6e6a35ceabe2bce83b26073871e3b0;p=poolifier.git diff --git a/rollup.config.mjs b/rollup.config.mjs index 8f1f2656..3d069f7f 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -24,6 +24,7 @@ const availableParallelism = () => { const isDevelopmentBuild = env.BUILD === 'development' const isAnalyzeBuild = env.ANALYZE const isDocumentationBuild = env.DOCUMENTATION +const sourcemap = env.SOURCEMAP !== 'false' const maxWorkers = Math.floor(availableParallelism() / 2) @@ -36,21 +37,21 @@ export default defineConfig([ 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, @@ -58,8 +59,10 @@ export default defineConfig([ }), ...(!isDevelopmentBuild && { file: './lib/index.mjs', - sourcemap: true, plugins: [terser({ maxWorkers })] + }), + ...(sourcemap && { + sourcemap }) } ],