-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
57 lines (56 loc) · 1.71 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import typescript from "@rollup/plugin-typescript";
import svelte from 'rollup-plugin-svelte';
import sveltePreprocess from 'svelte-preprocess';
import css from 'rollup-plugin-css-only';
import resolve from '@rollup/plugin-node-resolve';
import copy from 'rollup-plugin-copy'
export default [{
input: ['src/content-scripts/index.ts'],
output: [
{ file: 'dist/chrome/content-scripts.js', format: 'iife' },
{ file: 'dist/firefox/content-scripts.js', format: 'iife' },
],
plugins: [typescript()]
}, {
input: ['src/background.ts'],
output: [
{ file: 'dist/chrome/background.js', format: 'iife' },
],
plugins: [typescript()]
}, {
input: ['src/popup/index.ts'],
output: [
{ file: 'dist/chrome/popup/bundle.js', format: 'iife', name: 'app' }
],
plugins: [
svelte({ preprocess: sveltePreprocess() }),
css({ output: 'bundle.css' }),
copy({targets: [
{src: 'public/index.html', dest: 'dist/chrome/popup'},
{src: ['public/icon.png', 'public/chrome/manifest.json'], dest: 'dist/chrome'},
]}),
resolve({
browser: true,
dedupe: ['svelte']
}),
typescript()
]
}, {
input: ['src/popup/index.ts'],
output: [
{ file: 'dist/firefox/popup/bundle.js', format: 'iife', name: 'app' }
],
plugins: [
svelte({ preprocess: sveltePreprocess() }),
css({ output: 'bundle.css' }),
copy({targets: [
{src: 'public/index.html', dest: 'dist/firefox/popup'},
{src: ['public/icon.png', 'public/firefox/manifest.json'], dest: 'dist/firefox'},
]}),
resolve({
browser: true,
dedupe: ['svelte']
}),
typescript()
]
}];