make build-all script windows-friendly (or windows-friendlier)
still requires bash tho
This commit is contained in:
parent
2cf42cb6ed
commit
8e544a6ae0
@ -5,7 +5,7 @@
|
|||||||
"author": "Tamius Han <tamius.han@gmail.com>",
|
"author": "Tamius Han <tamius.han@gmail.com>",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run pre-build; cross-env NODE_ENV=production BROWSER=firefox CHANNEL=stable webpack --hide-modules",
|
"build": "npm run pre-build; cross-env NODE_ENV=production BROWSER=firefox CHANNEL=stable webpack --hide-modules",
|
||||||
"build-all": "mkdir -p ./build/old; npm run pre-build; rm ./dist-zip/uw-amo-source.zip; mv -f ./dist-zip/*.zip ./build/old; npm run build; node scripts/build-zip.js ff; npm run build-chrome; node scripts/build-zip.js chrome; npm run build-edge; node scripts/build-zip.js edge; ./scripts/prepare-amo-source.sh",
|
"build-all": "bash ./scripts/build-all.sh",
|
||||||
"build-chrome": "cross-env NODE_ENV=production BROWSER=chrome CHANNEL=stable webpack --hide-modules",
|
"build-chrome": "cross-env NODE_ENV=production BROWSER=chrome CHANNEL=stable webpack --hide-modules",
|
||||||
"build-chrome:dev": "cross-env NODE_ENV=development BROWSER=chrome webpack --hide-modules",
|
"build-chrome:dev": "cross-env NODE_ENV=development BROWSER=chrome webpack --hide-modules",
|
||||||
"build-edge": "cross-env NODE_ENV=production BROWSER=edge CHANNEL=stable webpack --hide-modules",
|
"build-edge": "cross-env NODE_ENV=production BROWSER=edge CHANNEL=stable webpack --hide-modules",
|
||||||
|
39
scripts/build-all.sh
Normal file
39
scripts/build-all.sh
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# NOTE: this script needs to be run with the npm run build-all
|
||||||
|
# command from the root directory of the project. Running it in
|
||||||
|
# any other way probably isn't going to work.
|
||||||
|
|
||||||
|
# pre-build steps:
|
||||||
|
mkdir -p ./build/old
|
||||||
|
npm run pre-build
|
||||||
|
rm ./dist-zip/uw-amo-source.zip
|
||||||
|
mv -f ./dist-zip/*.zip ./build/old
|
||||||
|
|
||||||
|
# build the version for each browser and create a zip afterwards
|
||||||
|
# step 1: define build functions
|
||||||
|
#function buildFF {
|
||||||
|
npm run build
|
||||||
|
node scripts/build-zip.js ff
|
||||||
|
#}
|
||||||
|
#function buildChrome {
|
||||||
|
npm run build-chrome
|
||||||
|
node scripts/build-zip.js chrome
|
||||||
|
#}
|
||||||
|
#function buildEdge {
|
||||||
|
npm run build-edge
|
||||||
|
node scripts/build-zip.js edge
|
||||||
|
#}
|
||||||
|
|
||||||
|
# step 2: execute them all at once
|
||||||
|
# buildFF &
|
||||||
|
# buildChrome &
|
||||||
|
# buildEdge &
|
||||||
|
|
||||||
|
# wait < <(jobs -p)
|
||||||
|
|
||||||
|
# prepare AMO source
|
||||||
|
# source code needs to be prepared AFTER
|
||||||
|
# the code has been built, to ensure that
|
||||||
|
# package-lock.json remains unchanged
|
||||||
|
./scripts/prepare-amo-source.sh
|
Loading…
Reference in New Issue
Block a user