X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.mjs;h=d4af3f3ff624310388649f22934a60e7cf867d18;hb=refs%2Ftags%2Fv3.1.7;hp=e3af7e1d8af9657fe50be3750b7aa4acd8671a25;hpb=211b4eb5ca5829653a7bf63d4df5c3f1aa4df755;p=poolifier.git diff --git a/rollup.config.mjs b/rollup.config.mjs index e3af7e1d..d4af3f3f 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) @@ -34,7 +35,6 @@ export default defineConfig([ output: [ { format: 'cjs', - sourcemap: true, ...(isDevelopmentBuild && { dir: './lib', preserveModules: true, @@ -43,11 +43,13 @@ export default defineConfig([ ...(!isDevelopmentBuild && { file: './lib/index.js', plugins: [terser({ maxWorkers })] + }), + ...(sourcemap && { + sourcemap }) }, { format: 'esm', - sourcemap: true, ...(isDevelopmentBuild && { dir: './lib', entryFileNames: '[name].mjs', @@ -58,6 +60,9 @@ export default defineConfig([ ...(!isDevelopmentBuild && { file: './lib/index.mjs', plugins: [terser({ maxWorkers })] + }), + ...(sourcemap && { + sourcemap }) } ], @@ -66,7 +71,7 @@ export default defineConfig([ typescript({ tsconfig: './tsconfig.build.json', compilerOptions: { - sourceMap: true + sourceMap: sourcemap } }), del({