-
Notifications
You must be signed in to change notification settings - Fork 9
/
rollup.config.js
44 lines (42 loc) · 1.15 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
import { nodeResolve } from '@rollup/plugin-node-resolve';
import { terser } from "rollup-plugin-terser";
import css from "rollup-plugin-import-css";
import typescript from '@rollup/plugin-typescript';
import commonjs from '@rollup/plugin-commonjs';
const terserConfig = {
module: true,
}
export default [
{
input: 'js/main.js',
watch: {
include: 'js/**',
clearScreen: false
},
output: {
file: 'static/dist/main.js',
format: 'es',
plugins: [terser(terserConfig)],
},
onwarn: function onwarn(message, warn) {
// Ignore eval warning - Google's official protobuf implementation uses it
// and I don't need to be informed of that every single time
if (message.code === 'EVAL') return;
warn(message);
},
plugins: [css(), nodeResolve(), typescript({compilerOptions: {target: "es6"}}), commonjs()]
},
{
input: 'js/viewer/viewer.js',
watch: {
include: 'js/viewer/**',
clearScreen: false
},
output: {
file: 'static/dist/viewer.js',
format: 'es',
plugins: [terser(terserConfig)]
},
plugins: [css(), nodeResolve()]
}
];