about summary refs log tree commit diff stats
path: root/rollup.config.js
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2024-07-25 15:17:57 +0300
committerManeraKai <manerakai@protonmail.com>2024-07-25 15:17:57 +0300
commitc6de68c4c4bda3edcf6cf012bd98adea3baf866b (patch)
tree419e5cb8cdfe04fd734c5590e78888fa16e58e51 /rollup.config.js
parentMade Select Frontend searchable and with icons (diff)
downloadlibredirect-c6de68c4c4bda3edcf6cf012bd98adea3baf866b.zip
Migrating popup to svelte
Diffstat (limited to 'rollup.config.js')
-rw-r--r--rollup.config.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/rollup.config.js b/rollup.config.js
index 71222de8..5a2ce362 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -5,14 +5,23 @@ 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"
+}
 
 export default {
-  input: "src/pages/src/main.js",
+  input,
   output: {
     sourcemap: true,
     format: "iife",
     name: "app",
-    file: "src/pages/options/build/bundle.js",
+    file: output,
   },
   plugins: [
     svelte({
@@ -27,7 +36,7 @@ export default {
       exportConditions: ["svelte"],
     }),
     commonjs(),
-    // production && terser(),
+    production && terser(),
   ],
   watch: {
     clearScreen: false,