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