-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
50 lines (46 loc) · 1.1 KB
/
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
45
46
47
48
49
50
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import { join } from 'path'
import babel from 'rollup-plugin-babel'
import deepmerge from 'deepmerge'
const baseConfig = {
input: join(__dirname, 'index.js'),
output: {
name: 'Sandhands'
},
name: 'Sandhands',
plugins: [
resolve({ jsnext: true }),
commonjs({
include: 'node_modules/**'
}),
babel({
exclude: 'node_modules/**',
presets: ['@babel/preset-env'],
sourceMaps: 'inline'
})
]
}
const branchConfigs = [
{
output: {
format: 'iife',
file: join(__dirname, 'dist', 'Sandhands-browser.js')
}
},
{
output: {
format: 'cjs',
file: join(__dirname, 'dist', 'Sandhands-commonjs.js')
}
},
{
output: {
format: 'umd',
file: join(__dirname, 'dist', 'Sandhands-universal.js')
}
}
]
const configs = branchConfigs.map(config => deepmerge(baseConfig, config))
configs[1].plugins.splice(0, 1) // Don't include dependencies in node bundle
export default configs