From d806787092568a77e6e98d7dba16776342c56326 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 26 Nov 2023 15:50:13 +0100 Subject: [PATCH] build: revert commit 211b4eb MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- package.json | 2 +- rollup.config.mjs | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index dcaadc2b..62477b59 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "benchmark": "pnpm build && node --max-old-space-size=4096 --enable-source-maps benchmarks/internal/bench.mjs", "benchmark:prod": "pnpm build:prod && node --max-old-space-size=4096 --enable-source-maps benchmarks/internal/bench.mjs", "benchmark:debug": "pnpm build && node --max-old-space-size=4096 --enable-source-maps --inspect benchmarks/internal/bench.mjs", - "test": "pnpm build && c8 mocha 'tests/**/*.test.mjs'", + "test": "pnpm build --environment SOURCEMAP:false && c8 mocha 'tests/**/*.test.mjs'", "test:debug": "pnpm build && mocha --no-parallel --inspect 'tests/**/*.test.mjs'", "coverage": "c8 report --reporter=lcov", "coverage:html": "c8 report --reporter=html", 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({ -- 2.34.1