forked from 7rulnik/gtlb-job-log-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-manifest.js
33 lines (27 loc) · 855 Bytes
/
update-manifest.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
var fs = require("fs");
const manifestPath = "./build/manifest.json";
const manifest = require('./public/manifest.json');
const assetManifest = require("./build/asset-manifest.json");
const cssEntrypoints = assetManifest.entrypoints.filter((file) =>
file.endsWith(".css")
);
const jsEntrypoint = assetManifest.entrypoints.filter((file) =>
file.endsWith(".js")
);
const contentScripsOtps = {
content_scripts: [
{
matches: ["*://*/*/-/jobs/*/raw", "*://*/*/*/*/*/*/*/job.log*", "https://storage.googleapis.com/gitlab-gprd-artifacts/*/job.log*"],
css: cssEntrypoints,
js: jsEntrypoint,
},
],
};
const extendedManifest = {
...manifest,
...contentScripsOtps,
};
console.log("New manifest will be:");
const json = JSON.stringify(extendedManifest, null, " ");
console.log(json);
fs.writeFileSync(manifestPath, json);