refactor: fix rollup configuration in examples
[poolifier.git] / examples / typescript / websocket-server-pool / ws-hybrid / rollup.config.mjs
CommitLineData
02999424
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'
02999424 5
5d4b2a88 6export default defineConfig({
02999424 7 input: [
78cdf6bc
JB
8 './src/main.ts',
9 './src/websocket-server-worker.ts',
10 './src/request-handler-worker.ts'
02999424
JB
11 ],
12 strictDeprecations: true,
13 output: [
14 {
15 format: 'cjs',
78cdf6bc 16 dir: './dist',
02999424
JB
17 sourcemap: true,
18 entryFileNames: '[name].cjs',
efaeaba6 19 chunkFileNames: '[name]-[hash].cjs'
02999424
JB
20 },
21 {
22 format: 'esm',
78cdf6bc 23 dir: './dist',
efaeaba6 24 sourcemap: true
02999424
JB
25 }
26 ],
27 external: ['node:path', 'node:url', 'poolifier', 'ws'],
28 plugins: [
29 typescript(),
30 del({
78cdf6bc 31 targets: ['./dist/*']
02999424
JB
32 })
33 ]
5d4b2a88 34})