-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.mjs
46 lines (43 loc) · 899 Bytes
/
rollup.config.mjs
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
45
46
import svelte from 'rollup-plugin-svelte';
import resolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
import postcss from 'rollup-plugin-postcss';
const production = !process.env.ROLLUP_WATCH;
const config = {
output: {
sourcemap: true,
format: 'es',
dir: '_site/assets/js',
},
plugins: [
svelte({
compilerOptions: {
// enable run-time checks when not in production
dev: !production,
},
}),
resolve({
browser: true,
dedupe: ['svelte'],
}),
postcss({
config: {
path: './postcss.config.mjs',
ctx: {
env: production ? 'production' : null,
},
},
}),
production && terser(),
],
};
export default [
{
input: 'src/assets/js/fun.mjs',
...config,
},
{
input: 'src/assets/js/compare-image.mjs',
...config,
},
];