diff --git a/scripts/build-zip.js b/scripts/build-zip.js index 5bda202..079af9a 100644 --- a/scripts/build-zip.js +++ b/scripts/build-zip.js @@ -4,10 +4,6 @@ const fs = require('fs'); const path = require('path'); 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('../dist/manifest.json'); @@ -43,7 +39,14 @@ const buildZip = (src, dist, zipFilename) => { const main = () => { const browser = process.argv[2]; const testingOrNightly = process.argv[3]; - + let distDir; + if (browser == 'firefox') { + distDir = '../dist-ff'; + } else { + distDir = `../dist-${browser}` + } + const destDir = path.join(__dirname, distDir); + const zipDir = path.join(__dirname, '../dist-zip'); const {name, version} = extractExtensionData(); // collapse spaces and dashes into single dash @@ -52,9 +55,9 @@ const main = () => { let realZipDir; if (!!testingOrNightly) { - realZipDir = path.join(DEST_ZIP_DIR, version); + realZipDir = path.join(zipDir, version); } else { - realZipDir = path.join(DEST_ZIP_DIR); + realZipDir = path.join(zipDir); } const zipFilename = `${baseFilename}-${browser}.zip`; @@ -65,7 +68,7 @@ const main = () => { console.error('Failed to make directory.\nDirectory we wanted to make', realZipDir, '\nerror we got:\n', e) return 1; } - buildZip(DEST_DIR, realZipDir, zipFilename) + buildZip(destDir, realZipDir, zipFilename) .then(() => console.info('OK')) .catch(console.err); }; diff --git a/webpack.config.js b/webpack.config.js index 553da87..5a73d6f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -17,7 +17,7 @@ const config = { 'options/options': './options/options.js', }, output: { - path: __dirname + '/dist', + path: __dirname + `/dist-${process.node.BROWSER == 'firefox' ? 'ff' : process.node.BROWSER}`, filename: '[name].js', }, resolve: {