generated from jacksteamdev/chrome-extension-basic
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
32 lines (28 loc) · 867 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
/* eslint-env node */
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import zip from 'rollup-plugin-zip'
import { emptyDir } from 'rollup-plugin-empty-dir'
import { chromeExtension, simpleReloader } from 'rollup-plugin-chrome-extension'
const p = process.env.NODE_ENV === 'production'
export default {
input: ['src/manifest.json'],
output: {
dir: 'dist',
format: 'esm',
},
plugins: [
// always put chromeExtension() before other plugins
chromeExtension(),
// includes an automatic reloader in watch mode
simpleReloader(),
// resolves node modules
resolve(),
// converts libraries that use commonjs
commonjs(),
// empties the dist for each build
emptyDir(),
// creates a zip to upload to the Chrome Web Store :)
p && zip({ dir: 'releases' }),
],
}