forked from baloise/design-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.base.js
45 lines (40 loc) · 955 Bytes
/
rollup.base.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
import pkg from './package.json'
import lerna from './lerna.json'
function getAuthors(pkg) {
const { contributors } = pkg
const authors = new Set()
if (contributors && contributors)
contributors.forEach(contributor => {
const cs = contributor.split(' ')
cs.pop()
cs.pop()
authors.add(cs.join(' '))
})
return Array.from(authors).join(', ')
}
const banner = `/*!
* Baloise Design System v${lerna.version}
* (c) ${new Date().getFullYear()} ${getAuthors(pkg)}
* @license ${pkg.license}
*/`
export default {
input: 'dist-transpiled/index.js',
output: [
{
dir: 'dist/',
entryFileNames: '[name].esm.js',
chunkFileNames: '[name]-[hash].esm.js',
format: 'es',
banner,
sourcemap: true,
},
{
dir: 'dist/',
entryFileNames: '[name].js',
chunkFileNames: '[name]-[hash].js',
format: 'cjs',
banner,
sourcemap: true,
},
],
}