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