forked from algorandfoundation/algokit-subscriber-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
46 lines (44 loc) · 1.24 KB
/
rollup.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import typescript from '@rollup/plugin-typescript'
import type { LogLevel, LogOrStringHandler, RollupLog } from 'rollup'
import { RollupOptions } from 'rollup'
import pkg from './package.json' with { type: 'json' }
import { multiInput } from './rollup/multi-plugin'
const config: RollupOptions = {
input: ['src/index.ts', 'src/testing/index.ts', 'src/types/*.ts', '!src/types/*.spec.ts'],
output: [
{
dir: 'dist',
format: 'cjs',
entryFileNames: '[name].js',
preserveModules: true,
sourcemap: true,
dynamicImportInCjs: false,
},
{
dir: 'dist',
format: 'es',
entryFileNames: '[name].mjs',
preserveModules: true,
sourcemap: true,
},
],
treeshake: {
moduleSideEffects: false,
propertyReadSideEffects: false,
},
plugins: [
typescript({
tsconfig: 'tsconfig.build.json',
}),
multiInput(),
],
external: [...Object.keys(pkg.dependencies), ...Object.keys(pkg.peerDependencies), '@algorandfoundation/algokit-utils/types/indexer'],
onLog(level: LogLevel, log: RollupLog, handler: LogOrStringHandler) {
if (log.code === 'CIRCULAR_DEPENDENCY') {
handler('error', log)
} else {
handler(level, log)
}
},
}
export default config