From: Jérôme Benoit Date: Sat, 25 Nov 2023 08:57:28 +0000 (+0100) Subject: build: enable source map in test X-Git-Tag: v3.0.8~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=211b4eb5ca5829653a7bf63d4df5c3f1aa4df755;p=poolifier.git build: enable source map in test Signed-off-by: Jérôme Benoit --- diff --git a/package.json b/package.json index 0a84229a..6456f95e 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 --environment SOURCEMAP:false && c8 mocha 'tests/**/*.test.mjs'", + "test": "pnpm build && 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 d4af3f3f..e3af7e1d 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -24,7 +24,6 @@ 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) @@ -35,6 +34,7 @@ export default defineConfig([ output: [ { format: 'cjs', + sourcemap: true, ...(isDevelopmentBuild && { dir: './lib', preserveModules: true, @@ -43,13 +43,11 @@ export default defineConfig([ ...(!isDevelopmentBuild && { file: './lib/index.js', plugins: [terser({ maxWorkers })] - }), - ...(sourcemap && { - sourcemap }) }, { format: 'esm', + sourcemap: true, ...(isDevelopmentBuild && { dir: './lib', entryFileNames: '[name].mjs', @@ -60,9 +58,6 @@ export default defineConfig([ ...(!isDevelopmentBuild && { file: './lib/index.mjs', plugins: [terser({ maxWorkers })] - }), - ...(sourcemap && { - sourcemap }) } ], @@ -71,7 +66,7 @@ export default defineConfig([ typescript({ tsconfig: './tsconfig.build.json', compilerOptions: { - sourceMap: sourcemap + sourceMap: true } }), del({