forked from hidglobal/digitalpersona-sample-angularjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
34 lines (32 loc) · 1.04 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
// This configuration expects environment parameters passed to the rollup:
// (e.g. "rollup -c rollup.config.js --environment target:es5,format:umd,minify",
const {
minify, // true: minify the bundle, false|undefined: do not minify the bundle (default)
target, // target syntax (es5, es6, ...). Default: es5
format, // bundle format (umd, cjs, ...). Default: umd
npm_package_globalObject,
} = {
target: "es5",
format: "umd",
...process.env
}
import node from 'rollup-plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
export default {
input: `dist/${target}/index.js`,
external: [ 'u2f-api'],
output: {
format,
extend: true,
name: npm_package_globalObject, //'dp.accessManagement',
file: `dist/${target}.bundles/index.${format}${minify ? '.min' : ''}.js`,
sourcemap: true,
globals: {
'u2f-api': 'u2fApi',
},
},
plugins: [
node(),
(minify ? terser() : [])
]
}