-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathrollup.config.js
44 lines (40 loc) · 923 Bytes
/
rollup.config.js
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
import typescript from 'rollup-plugin-typescript2';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
/**
* @type {import('rollup').RollupOptions}
*/
const baseConfig = {
input: 'lib/index.ts',
plugins: [typescript({ tsconfigOverride: { exclude: ['**/__tests__/**'] } })],
};
const external = ['lodash.mergewith'];
/**
* @type {import('rollup').RollupOptions[]}
*/
const config = [
// CommonJS
{
...baseConfig,
output: { file: 'dist/fishery.js', format: 'cjs' },
external,
},
// ES Modules
{
...baseConfig,
output: { file: 'dist/fishery.mjs', format: 'es' },
external,
},
// UMD
{
...baseConfig,
output: {
file: 'dist/fishery.umd.js',
format: 'umd',
name: 'Fishery',
},
plugins: [...baseConfig.plugins, nodeResolve(), commonjs()],
external: [],
},
];
export default config;