-
-
Notifications
You must be signed in to change notification settings - Fork 123
/
rollup.config.js
48 lines (46 loc) · 1.13 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
import svelte from "rollup-plugin-svelte"
import commonjs from "@rollup/plugin-commonjs"
import terser from "@rollup/plugin-terser"
import resolve from "@rollup/plugin-node-resolve"
import css from "rollup-plugin-css-only"
const production = !process.env.ROLLUP_WATCH
let input
let output
if (process.argv.includes("--config-options")) {
input = "src/pages/options_src/main.js"
output = "src/pages/options/build/bundle.js"
} else if (process.argv.includes("--config-popup")) {
input = "src/pages/popup_src/main.js"
output = "src/pages/popup/build/bundle.js"
}
else if (process.argv.includes("--config-messages")) {
input = "src/pages/messages_src/main.js"
output = "src/pages/messages/build/bundle.js"
}
export default {
input,
output: {
sourcemap: true,
format: "iife",
name: "app",
file: output,
},
plugins: [
svelte({
compilerOptions: {
dev: !production,
},
}),
css({ output: "bundle.css" }),
resolve({
browser: true,
dedupe: ["svelte"],
exportConditions: ["svelte"],
}),
commonjs(),
production && terser(),
],
watch: {
clearScreen: false,
},
}