libredirect/rollup.config.js

45 lines
1014 B
JavaScript
Raw Normal View History

2024-07-24 11:20:49 +02:00
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
2024-07-25 14:17:57 +02:00
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"
}
2024-07-24 11:20:49 +02:00
export default {
2024-07-25 14:17:57 +02:00
input,
2024-07-24 11:20:49 +02:00
output: {
sourcemap: true,
format: "iife",
name: "app",
2024-07-25 14:17:57 +02:00
file: output,
2024-07-24 11:20:49 +02:00
},
plugins: [
svelte({
compilerOptions: {
dev: !production,
},
}),
css({ output: "bundle.css" }),
resolve({
browser: true,
dedupe: ["svelte"],
exportConditions: ["svelte"],
}),
commonjs(),
2024-07-25 14:17:57 +02:00
production && terser(),
2024-07-24 11:20:49 +02:00
],
watch: {
clearScreen: false,
},
}