forked from vilaboim/vuecloak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
44 lines (35 loc) · 938 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 pkg from './package.json'
function getAuthors(pkg) {
const { contributors, author } = pkg
const authors = new Set()
if (contributors) {
contributors.forEach((contributor) => {
authors.add(contributor.name)
})
}
if (author) authors.add(author.name)
return Array.from(authors).join(', ')
}
const banner = `/*!
* ${pkg.name} v${pkg.version}
* (c) ${new Date().getFullYear()} ${getAuthors(pkg)}
* @license ${pkg.license}
*/`
const name = 'vuecloak'
const globals = {
'keycloak-js': 'Keycloak'
}
const outputConfigs = {
cjs: pkg.main,
es: pkg.module,
umd: pkg.browser
}
const outputFormats = Object.keys(outputConfigs)
function createOutput(file, format) {
return { file, format, banner, name, globals }
}
export default {
input: 'src/index.js',
output: outputFormats.map(format => createOutput(outputConfigs[format], format)),
external: ['keycloak-js', '@vue/devtools-api']
}