-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
43 lines (41 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
import copy from 'rollup-plugin-copy';
import resolve from 'rollup-plugin-node-resolve';
import buble from '@rollup/plugin-buble';
import { terser } from 'rollup-plugin-terser';
import serve from 'rollup-plugin-serve';
import livereload from 'rollup-plugin-livereload';
import svelte from 'rollup-plugin-svelte';
import json from '@rollup/plugin-json';
import dsv from '@rollup/plugin-dsv';
const production = !process.env.ROLLUP_WATCH;
export default {
input: 'src/main.js',
output: {
name: 'datavis',
file: 'docs/bundle.js',
format: 'iife',
sourcemap: !production && true
},
plugins: [
copy({
targets: [{ src: ['src/index.html', 'src/global.css'], dest: 'docs/' }]
}),
svelte({
dev: !production,
css: css => {
css.write('docs/bundle.css');
}
}),
resolve(),
json(),
dsv(),
!production &&
serve({
contentBase: 'docs/',
port: 4000
}),
!production && livereload(),
production && buble(),
production && terser()
]
};