-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·17 lines (16 loc) · 1019 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
# nodepub depends on archiver, which in turn depends on the entire NPM
# package archive apparently; luckily, this use case doesn't use
# archiver, so we ignore it
if [[ $1 == "dev" ]]; then
node_modules/.bin/browserify --ignore archiver webextension/background.js >webextension/browser_pack.js
rm -rf webextension-brave
cp -a webextension webextension-brave
mv webextension-brave/manifest-brave.json webextension-brave/manifest.json
cp node_modules/webextension-polyfill/dist/browser-polyfill.min.js webextension-brave
else
# node_modules/.bin/browserify --ignore archiver --ignore jsdom webextension/background.js --plugin tinyify >webextension/browser_pack.js
node_modules/.bin/browserify --ignore archiver --ignore jsdom webextension/background.js >webextension/browser_pack.js
node_modules/uglify-js/bin/uglifyjs webextension/browser_pack.js --compress -o webextension/browser_pack.js
web-ext build -s webextension/ -i jszip.js -i background.js --overwrite-dest
fi