-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
42 lines (35 loc) · 964 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
const rollup = require('rollup');
import serve from 'rollup-plugin-serve';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import { terser } from 'rollup-plugin-terser';
const production = !process.env.ROLLUP_WATCH;
const options = {
input: 'src/main.js',
output: {
file: 'dist/bundle.js',
format: 'umd',
sourcemap: true,
name: 'extractVideoFrames'
},
plugins: [
serve({
host: 'localhost',
port: 8080,
contentBase: ['']
}),
resolve(() => {
console.log(123)
}),
commonjs(),
production && terser()
]
};
const watcher = rollup.watch(options);
watcher.on('event', event => {
// console.log(event, event.code)
if (event.code === 'BUNDLE_END') {
console.log('launch at: http://localhost:8080/example/index.html')
}
});
export default options;