X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=rollup.config.mjs;h=aac1c8cdd00740db11a5c031b31b14c850049c17;hb=410724041bab556be1385c56f9a32e5030f6f2cf;hp=e0c97bd6e4ebe607ec56d4c526c43206a6215393;hpb=0b60de1faea2ed2ebbbf77393ab4d280b7a897a2;p=poolifier.git diff --git a/rollup.config.mjs b/rollup.config.mjs index e0c97bd6..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() ] } -] +])