-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
46 lines (41 loc) · 1.07 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
import babel from '@rollup/plugin-babel';
import { terser } from "rollup-plugin-terser";
import { string } from "rollup-plugin-string";
var buildMinifiedLibrary = shouldMinify(process.argv);
var plugins = [
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**' // only transpile our source code
}),
string({
// Required to be specified
include: "**/*.html",
// Undefined by default
exclude: ["**/index.html"]
})
];
if (buildMinifiedLibrary) {
plugins.unshift(terser());
}
function shouldMinify(args) {
return (args || []).indexOf('--minify') > -1;
}
export default {
input: 'src/scripts/index.js',
output: {
format: 'iife',
file: 'public/index.js',
name: 'AdaptiveEditor',
globals: {
adaptivecards: 'window.AdaptiveCards',
'adaptive-html': 'window.AdaptiveHtml',
'simple-track': 'window.SimpleTrack'
}
},
plugins: plugins,
external: [
'adaptivecards',
'adaptive-html',
'simple-track'
],
};