forked from dollarshaveclub/shave
-
Notifications
You must be signed in to change notification settings - Fork 10
/
rollup.config.js
41 lines (35 loc) · 1.17 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
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import typescript from '@rollup/plugin-typescript'
import { uglify } from 'rollup-plugin-uglify'
const json = require('./package.json')
const { author, description, homepage, license, name, version } = json
const banner = `/**
${name} - ${description}
@version v${version}
@link ${homepage}
@author ${author}
@license ${license}
**/`
const plugins = [
resolve(),
commonjs(),
typescript({ tsconfig: false, lib: ['esnext', 'dom', 'dom.iterable'], target: 'es5', downlevelIteration: true }),
]
const inputs = ['shave', 'jquery.shave']
const esRollups = inputs.map((name) => ({
input: `src/${name}.ts`,
output: { banner, name, file: `dist/${name}.es.js`, format: 'es' },
plugins,
}))
const umdRollups = inputs.map((name) => ({
input: `src/${name}.ts`,
output: { banner, name, file: `dist/${name}.js`, format: 'umd' },
plugins,
}))
const minRollups = inputs.map((name) => ({
input: `src/${name}.ts`,
output: { banner, name, file: `dist/${name}.min.js`, format: 'umd' },
plugins: [...plugins, uglify()],
}))
export default [...esRollups, ...umdRollups, ...minRollups]