forked from dsb-norge/vue-keycloak-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
67 lines (65 loc) · 1.53 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import babel from '@rollup/plugin-babel'
import typescript from 'rollup-plugin-typescript2'
import pkg from './package.json'
// eslint-disable-next-line @typescript-eslint/no-var-requires
const version = process.env.VERSION || require('./package.json').version
const banner = `/*!
* vue-keycloak-js v${version}
* @license ISC
*/`
const name = 'dsb-vue-keycloak'
const globals = {
'@vue/reactivity': 'Reactivity',
'keycloak-js': 'Keycloak',
}
const inlineDynamicImports = true
// CommonJS (for Node), ES module (for bundlers) and browser-friendly UMD build.
export default {
input: 'src/index.ts',
output: [
{
exports: 'default',
file: pkg.main,
format: 'cjs',
banner,
name,
globals,
inlineDynamicImports
},
{
exports: 'default',
file: pkg.module,
format: 'es',
banner,
name,
globals,
inlineDynamicImports
},
{
exports: 'default',
file: pkg.browser,
format: 'umd',
banner,
name,
globals,
inlineDynamicImports
},
],
plugins: [
resolve(), // so Rollup can find `keycloak-js`
commonjs(), // so Rollup can convert `keycloak-js` to an ES module
typescript({
tsconfigOverride: {
include: ['src/**/*'],
exclude: ['node_modules'],
},
}),
babel({
exclude: ['node_modules/**'],
babelHelpers: 'bundled',
}),
],
external: ['vue', 'keycloak-js'],
}