test: add more event emitter tests
[poolifier.git] / rollup.config.mjs
index e0c97bd6e4ebe607ec56d4c526c43206a6215393..aac1c8cdd00740db11a5c031b31b14c850049c17 100644 (file)
@@ -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()
     ]
   }
-]
+])