-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
34 lines (32 loc) · 877 Bytes
/
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
import commonjs from "@rollup/plugin-commonjs";
import zip from "rollup-plugin-zip";
import postcss from "rollup-plugin-postcss";
import { terser } from "rollup-plugin-terser";
import {
chromeExtension,
simpleReloader,
} from "rollup-plugin-chrome-extension";
import { emptyDir } from "rollup-plugin-empty-dir";
const production = !process.env.ROLLUP_WATCH;
export default {
input: "src/manifest.json",
output: {
dir: "dist",
format: "esm",
},
plugins: [
// always put chromeExtension() before other plugins
chromeExtension(),
simpleReloader(),
postcss({
minimize: production
}),
commonjs(),
// Empties the output dir before a new build
emptyDir(),
// If we're building for production, minify
production && terser(),
// Outputs a zip file in ./releases
production && zip({ dir: "releases" }),
],
};