-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.browser-test.js
43 lines (37 loc) · 1.27 KB
/
rollup.config.browser-test.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
import path from 'path';
import resolve from '@rollup/plugin-node-resolve';
import istanbul from 'rollup-plugin-istanbul'; // Adds Istanbul instrumentation.
// The test browser distribution is bundled to `./test/public`.
const s_TEST_BROWSER_PATH = './test/public';
// Produce sourcemaps or not.
const s_SOURCEMAP = true;
const relativeTestBrowserPath = path.relative(`${s_TEST_BROWSER_PATH}`, '.');
export default () =>
{
return [{ // This bundle is for the Istanbul instrumented browser test.
input: ['src/browser/index.js'],
output: [{
file: `${s_TEST_BROWSER_PATH}/ModuleLoader.js`,
format: 'es',
generatedCode: { constBindings: true },
sourcemap: s_SOURCEMAP,
sourcemapPathTransform: (sourcePath) => sourcePath.replace(relativeTestBrowserPath, `.`)
}],
plugins: [
istanbul()
]
},
// This bundle is the test suite
{
input: ['test/src/runner/TestSuiteRunner.js'],
output: [{
file: `${s_TEST_BROWSER_PATH}/TestSuiteRunner.js`,
format: 'es',
generatedCode: { constBindings: true },
}],
plugins: [
resolve({ browser: true })
]
}
];
};