-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
33 lines (31 loc) · 1016 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
// rollup.config.js
import terser from '@rollup/plugin-terser'
const inputs = ['index', 'react']
const formats = ['esm', 'cjs']
export default inputs.reduce((acc, input) => {
acc.push(
...formats.map((format) => ({
input: `src/${input}.js`,
output: {
name: 'deepEqual',
file: `dist/${input !== 'index' ? `${input}/index` : input}${
format === 'umd' ? '' : `.${format === 'esm' ? 'js' : `${format}`}`
}`,
format,
},
plugins: [
terser({
module: true,
compress: { defaults: false, module: true, hoist_vars: true, join_vars: false, sequences: false },
mangle: true,
output: {
beautify: false,
},
parse: {},
rename: {},
}),
],
}))
)
return acc
}, [])