forked from webdriverio-community/wdio-video-reporter
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrollup.config.js
46 lines (43 loc) · 930 Bytes
/
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
import { readFileSync } from 'fs';
import { extname } from 'path';
import { createFilter } from 'rollup-pluginutils';
import resolve from 'rollup-plugin-node-resolve';
/**
* Transform imports of pngs to base64
*/
const png = (options = {}) => {
const filter = createFilter(options.include, options.exclude);
return {
name: 'png',
load(id) {
if (filter(id) && extname(id) === '.png') {
return `export default '${readFileSync(id, 'base64')}'`;
}
},
};
};
module.exports = {
input: 'src/index.js',
output: {
name: 'VideoRecorder',
file: 'dist/wdio-video-reporter.js',
format: 'cjs',
sourcemap: true,
},
plugins: [
png(),
resolve({
modulesOnly: true,
}),
],
external: [
'mkdirp',
'fs-extra',
'@ffmpeg-installer/ffmpeg',
'@wdio/reporter',
'@wdio/allure-reporter',
'system-sleep',
'path',
'child_process',
],
};