forked from mozilla-rally/rally-core-addon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.addon.js
43 lines (41 loc) · 1.22 KB
/
rollup.config.addon.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
42
43
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import replace from '@rollup/plugin-replace';
export default (cliArgs) => {
return [
{
input: "core-addon/background.js",
output: {
file: "public/addon-build/background.js"
},
plugins: [
replace({
__ION_STUDIES_LIST__: cliArgs['config-study-list-url'] ?
`'${cliArgs['config-study-list-url']}'` :
"'https://firefox.settings.services.mozilla.com/v1/buckets/main/collections/pioneer-study-addons-v1/records'",
__ION_WEBSITE_URL__: cliArgs['config-website'] ?
`'${cliArgs['config-website']}'` :
"'https://rally-stage.bespoke.nonprod.dataops.mozgcp.net'",
}),
resolve({
browser: true,
}),
commonjs(),
],
},
{
input: "core-addon/content-script.js",
output: {
file: "public/addon-build/content-script.js"
},
plugins: [
resolve({
browser: true,
}),
commonjs(),
],
},
]};