-
Notifications
You must be signed in to change notification settings - Fork 5
/
rollup.config.ts
45 lines (44 loc) · 1.03 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
import nodeResolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
import json from '@rollup/plugin-json'
import type { RollupOptions } from 'rollup'
import pkg from './package.json' with { type: 'json' }
const config: RollupOptions = {
input: ['src/index.ts', 'src/cli.ts'],
output: [
{
dir: 'dist',
format: 'cjs',
entryFileNames: '[name].js',
exports: 'named',
preserveModules: true,
sourcemap: true,
},
{
dir: 'dist',
format: 'es',
exports: 'named',
entryFileNames: '[name].mjs',
preserveModules: true,
sourcemap: true,
},
],
treeshake: {
moduleSideEffects: false,
propertyReadSideEffects: false,
},
external: [
...Object.keys(pkg.dependencies),
...Object.keys(pkg.peerDependencies),
/^@algorandfoundation\/algokit-utils\/types\/*/,
/^algosdk\/*/,
],
plugins: [
typescript({
tsconfig: 'tsconfig.build.json',
}),
nodeResolve(),
json(),
],
}
export default config