-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild-firefox.ps1
39 lines (30 loc) · 1.04 KB
/
build-firefox.ps1
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
$ZipPath = "./firefox-dist.zip"
if (Test-Path $ZipPath) {
Remove-Item $ZipPath
}
if (Test-Path "manifest.json") {
Remove-Item "manifest.json"
}
Copy-Item "./firefox/manifest.json" -Destination "./manifest.json"
if (Test-Path "storage.js") {
Remove-Item "storage.js"
}
Copy-Item "./firefox/storage.js" -Destination "./storage.js"
if (Test-Path "backgroundScriptTriggers.js") {
Remove-Item "backgroundScriptTriggers.js"
}
Copy-Item "./firefox/backgroundScriptTriggers.js" -Destination "./backgroundScriptTriggers.js"
if (Test-Path "main.min.js") {
Remove-Item "main.min.js"
}
npx rollup ./main.js --file ./main.min.js --format iife
if (Test-Path "popup.min.js") {
Remove-Item "popup.min.js"
}
npx rollup ./popup.js --file ./popup.min.js --format iife
$7ZipPath = "C:/Program Files/7-Zip/7z.exe"
if (-not (Test-Path -Path $7zipPath -PathType Leaf)) {
throw "7 zip file '$7zipPath' not found"
}
Set-Alias 7zip $7zipPath
7zip a -tzip $ZipPath "./icons", "entry.html", "main.min.js", "manifest.json", "popup.min.js", "styles.css", "popup.css"