-
Notifications
You must be signed in to change notification settings - Fork 44
/
rollup.test.config.js
46 lines (42 loc) · 1.25 KB
/
rollup.test.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
const { ENVIRONMENT, TESTTYPE } = process.env;
import resolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-babel';
import typescript from '@rollup/plugin-typescript';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
const extensions = ['.js', '.ts'];
const builds = {
main: {
input: 'test/src/_test.index.ts',
output: {
file: 'test/test-bundle.js',
format: 'iife',
name: 'mParticleTests',
sourcemap: ENVIRONMENT !== 'prod',
},
plugins: [
resolve(),
commonjs({
include: 'node_modules/**',
namedExports: { chai: ['expect'] },
}),
babel({
extensions,
include: ['src/**/*'],
babelHelpers: 'runtime',
}),
typescript({ tsconfig: './tsconfig.json' }),
json(),
],
},
stub: {
input: 'test/stub/tests-mParticle-stub.js',
output: {
file: 'test/stub/test-stub-bundle.js',
format: 'iife',
name: 'mParticleStubTests',
},
plugins: [resolve(), json()],
},
};
export default builds[TESTTYPE];