diff --git a/package.json b/package.json index 621c014..a1312b2 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "build:dev": "cross-env NODE_ENV=development BROWSER=firefox webpack --hide-modules", "build-chrome:dev": "cross-env NODE_ENV=development BROWSER=chrome webpack --hide-modules", "build-edge:dev": "cross-env NODE_ENV=development BROWSER=edge webpack --hide-modules", + "build-all": "rm ./dist-zip/uw-amo-source.zip; mv ./dist-zip/*.zip ./dist-zip/old/; npm run build; node scripts/build-zip.js ff; npm run build-chrome; node scripts/build-zip.js chrome; ./scripts/prepare-amo-source.sh", "build-zip": "node scripts/build-zip.js", "watch": "npm run build -- --watch", "watch-chrome": "npm run build-chrome -- --watch", diff --git a/scripts/build-zip.js b/scripts/build-zip.js index 9a84c2a..9f1380a 100644 --- a/scripts/build-zip.js +++ b/scripts/build-zip.js @@ -7,8 +7,9 @@ const archiver = require('archiver'); const DEST_DIR = path.join(__dirname, '../dist'); const DEST_ZIP_DIR = path.join(__dirname, '../dist-zip'); + const extractExtensionData = () => { - const extPackageJson = require('../package.json'); + const extPackageJson = require('../src/manifest.json'); return { name: extPackageJson.name, @@ -40,8 +41,10 @@ const buildZip = (src, dist, zipFilename) => { }; const main = () => { + const browser = process.argv[2]; + const {name, version} = extractExtensionData(); - const zipFilename = `${name}-v${version}.zip`; + const zipFilename = `${name}-${version}-${browser}.zip`; makeDestZipDirIfNotExists(); diff --git a/scripts/prepare-amo-source.sh b/scripts/prepare-amo-source.sh new file mode 100755 index 0000000..3ca4e19 --- /dev/null +++ b/scripts/prepare-amo-source.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# makes a zip file with human-readable source code that we need to upload to AMO +# since webpack minifies stuff +zip -r dist-zip/uw-amo-source.zip README-AMO.md .babelrc package.json package-lock.json webpack.config.js src/