-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
43 lines (41 loc) · 1 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
import nodeResolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import typescript from '@rollup/plugin-typescript'
import json from '@rollup/plugin-json'
import type { RollupOptions } from 'rollup'
const config: RollupOptions = {
input: ['src/index.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,
},
// List modules that should not be included in the output bundle (ie. they should remain external dependencies)
external: [/node_modules/],
plugins: [
typescript({
tsconfig: 'tsconfig.build.json',
}),
commonjs(),
nodeResolve(),
json(),
],
}
export default config