forked from covidatlas/coronadatascraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
40 lines (38 loc) · 1.05 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
const json = require('@rollup/plugin-json');
const serve = require('rollup-plugin-serve');
const livereload = require('rollup-plugin-livereload');
const copy = require('rollup-plugin-copy-glob');
const resolve = require('@rollup/plugin-node-resolve');
const postcss = require('rollup-plugin-postcss');
const postcssNested = require('postcss-nested');
const postcssImport = require('postcss-import');
const prod = !process.env.ROLLUP_WATCH;
module.exports = [
{
input: 'site/index.js',
output: {
file: 'dist/index.js',
format: 'iife',
sourcemap: true
},
plugins: [
resolve(),
json(),
!prod &&
serve({
contentBase: 'dist',
port: 8080
}),
!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
}
}
];