Commit | Line | Data |
---|---|---|
3b311539 JB |
1 | /* eslint-disable n/no-unpublished-import */ |
2 | import typescript from '@rollup/plugin-typescript' | |
3 | import del from 'rollup-plugin-delete' | |
4 | ||
5 | export default { | |
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 JB |
16 | sourcemap: true, |
17 | entryFileNames: '[name].cjs', | |
18 | preserveModules: true, | |
78cdf6bc | 19 | preserveModulesRoot: './src' |
3b311539 JB |
20 | }, |
21 | { | |
22 | format: 'esm', | |
78cdf6bc | 23 | dir: './dist', |
3b311539 JB |
24 | sourcemap: true, |
25 | preserveModules: true, | |
78cdf6bc | 26 | preserveModulesRoot: './src' |
3b311539 JB |
27 | } |
28 | ], | |
29 | external: ['fastify', 'fastify-plugin', 'node:path', 'node:url', 'poolifier'], | |
30 | plugins: [ | |
31 | typescript(), | |
32 | del({ | |
78cdf6bc | 33 | targets: ['./dist/*'] |
3b311539 JB |
34 | }) |
35 | ] | |
36 | } |