-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
47 lines (44 loc) · 1.15 KB
/
rollup.config.mjs
File metadata and controls
47 lines (44 loc) · 1.15 KB
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
47
import svelte from 'rollup-plugin-svelte';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import { terser } from 'rollup-plugin-terser';
import sveltePreprocess from 'svelte-preprocess';
import typescript from '@rollup/plugin-typescript';
import css from 'rollup-plugin-css-only';
const production = !process.env.ROLLUP_WATCH;
// Create separate configs for each entry point
export default ['sidebar'].map(name => ({
input: `webviews/pages/${name}.ts`,
output: {
file: `out/compiled/${name}.js`,
format: 'iife',
name: 'app',
sourcemap: true
},
plugins: [
svelte({
preprocess: sveltePreprocess(),
dev: !production,
emitCss: true
}),
css({
output: `${name}.css`
}),
resolve({
browser: true,
dedupe: ['svelte'],
extensions: ['.ts', '.js', '.svelte']
}),
commonjs(),
typescript({
tsconfig: "webviews/tsconfig.json",
sourceMap: !production,
inlineSources: !production,
include: ['webviews/**/*.ts', 'webviews/**/*.svelte']
}),
production && terser()
],
watch: {
clearScreen: false
}
}));