forked from covidatlas/coronadatascraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
40 lines (38 loc) · 1.01 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
import json from '@rollup/plugin-json';
import serve from 'rollup-plugin-serve';
import livereload from 'rollup-plugin-livereload';
import copy from 'rollup-plugin-copy-glob';
import resolve from '@rollup/plugin-node-resolve';
import postcss from 'rollup-plugin-postcss';
import postcssNested from 'postcss-nested';
import postcssImport from 'postcss-import';
const prod = !process.env.ROLLUP_WATCH;
export default [
{
input: 'site/index.js',
output: {
file: 'dist/index.js',
format: 'iife',
sourcemap: true
},
plugins: [
resolve(),
json(),
!prod &&
serve({
contentBase: 'dist',
port: 3000
}),
!prod && livereload({ watch: 'site' }),
copy([{ files: 'site/**/!(*.js|*.css|.DS_Store)', dest: 'dist' }], { verbose: true, watch: !prod }),
postcss({
inject: false,
extract: true,
plugins: [postcssImport(), postcssNested()]
})
],
watch: {
exclude: ['node_modules'] // jic
}
}
];