X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.mjs;h=aac1c8cdd00740db11a5c031b31b14c850049c17;hb=b560403426309944ad775794161773a745263190;hp=eb6226303a45726ce05b2916742298f9a7a0afd9;hpb=78cdf6bc0f67d72967aaeb948ec81479f875386b;p=poolifier.git diff --git a/rollup.config.mjs b/rollup.config.mjs index eb622630..aac1c8cd 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -5,6 +5,7 @@ import typescript from '@rollup/plugin-typescript' import analyze from 'rollup-plugin-analyzer' import command from 'rollup-plugin-command' import del from 'rollup-plugin-delete' +import { defineConfig } from 'rollup' const availableParallelism = () => { let availableParallelism = 1 @@ -25,7 +26,7 @@ const isDocumentationBuild = process.env.DOCUMENTATION const maxWorkers = Math.floor(availableParallelism() / 2) -export default [ +export default defineConfig([ { input: './src/index.ts', strictDeprecations: true, @@ -40,6 +41,7 @@ export default [ }), ...(!isDevelopmentBuild && { file: './lib/index.js', + sourcemap: true, plugins: [terser({ maxWorkers })] }) }, @@ -49,11 +51,13 @@ export default [ dir: './lib', sourcemap: true, entryFileNames: '[name].mjs', + chunkFileNames: '[name]-[hash].mjs', preserveModules: true, preserveModulesRoot: './src' }), ...(!isDevelopmentBuild && { file: './lib/index.mjs', + sourcemap: true, plugins: [terser({ maxWorkers })] }) } @@ -70,9 +74,7 @@ export default [ ], plugins: [ typescript({ - tsconfig: isDevelopmentBuild - ? 'tsconfig.development.json' - : 'tsconfig.production.json' + tsconfig: './tsconfig.build.json' }), del({ targets: ['./lib/*'] @@ -100,4 +102,4 @@ export default [ isAnalyzeBuild && analyze() ] } -] +])