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