refactor: fix rollup configuration in examples
[poolifier.git] / examples / typescript / http-server-pool / fastify-hybrid / rollup.config.mjs
CommitLineData
3b311539
JB
1/* eslint-disable n/no-unpublished-import */
2import typescript from '@rollup/plugin-typescript'
3import del from 'rollup-plugin-delete'
5d4b2a88 4import { defineConfig } from 'rollup'
3b311539 5
5d4b2a88 6export default defineConfig({
3b311539 7 input: [
78cdf6bc
JB
8 './src/main.ts',
9 './src/fastify-worker.ts',
10 './src/request-handler-worker.ts'
3b311539
JB
11 ],
12 strictDeprecations: true,
13 output: [
14 {
15 format: 'cjs',
78cdf6bc 16 dir: './dist',
3b311539 17 sourcemap: true,
efaeaba6
JB
18 entryFileNames: '[name].cjs',
19 chunkFileNames: '[name]-[hash].cjs'
3b311539
JB
20 },
21 {
22 format: 'esm',
78cdf6bc 23 dir: './dist',
2b6c61ec 24 sourcemap: true
3b311539
JB
25 }
26 ],
27 external: ['fastify', 'fastify-plugin', 'node:path', 'node:url', 'poolifier'],
28 plugins: [
29 typescript(),
30 del({
78cdf6bc 31 targets: ['./dist/*']
3b311539
JB
32 })
33 ]
5d4b2a88 34})