-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
52 lines (46 loc) · 1.41 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
// This file is all boilerplate. Do not edit unless you know what you're doing.
import {
production,
testEndToEnd,
} from './node_modules/@mparticle/web-kit-wrapper/rollup.base';
const { ENVIRONMENT } = process.env;
const initialization = require('./src/initialization');
const productionBuilds = {
iife: {
input: production.input,
output: {
...production.output,
format: 'iife',
file: `dist/${initialization.name}-Kit.iife.js`,
name: `${initialization.name}Kit`,
},
plugins: [...production.plugins],
},
cjs: {
input: production.input,
output: {
...production.output,
format: 'cjs',
file: `dist/${initialization.name}-Kit.common.js`,
name: `${initialization.name}Kit`,
},
plugins: [...production.plugins],
},
};
const testEndToEndBuild = {
input: testEndToEnd.input,
output: {
...testEndToEnd.output,
format: 'iife',
file: 'test/end-to-end-testapp/build/compilation.js',
name: `${initialization.name}Kit`,
},
plugins: [...testEndToEnd.plugins],
};
let selectedBuilds = [];
if (ENVIRONMENT === 'production') {
selectedBuilds.push(productionBuilds.iife, productionBuilds.cjs);
} else if (ENVIRONMENT === 'testEndToEnd') {
selectedBuilds.push(testEndToEndBuild);
}
export default selectedBuilds;