forked from ahallaha/tcgplayer-shopping-assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-chrome.ps1
42 lines (34 loc) · 1.07 KB
/
build-chrome.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
40
41
42
$ZipPath = "./chrome-dist.zip"
if (Test-Path $ZipPath) {
Remove-Item $ZipPath
}
if (Test-Path "manifest.json") {
Remove-Item "manifest.json"
}
Copy-Item "./chrome/manifest.json" -Destination "./manifest.json"
if (Test-Path "storage.js") {
Remove-Item "storage.js"
}
Copy-Item "./chrome/storage.js" -Destination "./storage.js"
if (Test-Path "backgroundScript.js") {
Remove-Item "backgroundScript.js"
}
Copy-Item "./chrome/backgroundScript.js" -Destination "./backgroundScript.js"
if (Test-Path "utils.js") {
Remove-Item "utils.js"
}
Copy-Item "./chrome/utils.js" -Destination "./utils.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
$compress = @{
Path = "./icons", "entry.html", "main.min.js", "manifest.json", "popup.min.js", "styles.css", "popup.css", "backgroundScript.js"
CompressionLevel = "Fastest"
DestinationPath = $ZipPath
}
Compress-Archive @compress