-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
41 lines (39 loc) · 1.22 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
import copy from 'rollup-copy-plugin'
import replace from 'rollup-plugin-replace'
import json from 'rollup-plugin-json'
const createConfig = (filename, bundleName) => {
return {
input: filename,
output: {
file: `dist/${bundleName}.js`,
format: 'iife'
},
plugins: [
json({ preferConst: true }),
replace({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}),
]
}
}
export default [
createConfig('src/backgroundScript/picket.js', 'picket'),
createConfig('src/popup/popup.js', 'popup'),
createConfig('src/blockedPage/blocked.js', 'blocked'),
createConfig('src/contentScripts/campaignLinks.js', 'campaignLinks'),
Object.assign(createConfig('src/warnBanner/addBanner.js', 'banner'),
{
plugins: [
copy({
'manifest.json': 'dist/manifest.json',
'src/popup/popup.html': 'dist/popup.html',
'src/popup/popup.css': 'dist/popup.css',
'src/blockedPage/blocked.html': 'dist/blocked.html',
'src/blockedPage/blocked.css': 'dist/blocked.css',
'website/css/custom.css': 'dist/custom.css',
'website/css/normalize.css': 'dist/normalize.css',
'website/css/skeleton.css': 'dist/skeleton.css'
})
]
})
]