diff --git a/.vscode/launch.json b/.vscode/launch.json index 42e9f96..8d96487 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,7 +11,7 @@ "port":6000, "reAttach": true, "addonType": "webExtension", - "addonPath": "${workspaceFolder}/dist", + "addonPath": "${workspaceFolder}/dist-ff", } ], "firefox": { diff --git a/package.json b/package.json index c549256..dae41e2 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,11 @@ "description": "Aspect ratio fixer for youtube and other sites, with automatic aspect ratio detection. Supports ultrawide and other ratios.", "author": "Tamius Han ", "scripts": { - "start": "cross-env HMR=true npm run build:dev -- --watch", + "start": "npm run dev", "build": "cross-env NODE_ENV=production BROWSER=firefox CHANNEL=stable webpack --hide-modules", "build-chrome": "cross-env NODE_ENV=production BROWSER=chrome CHANNEL=stable webpack --hide-modules", "build-edge": "cross-env NODE_ENV=production BROWSER=edge CHANNEL=stable webpack --hide-modules", - "build:dev": "cross-env NODE_ENV=development BROWSER=firefox CHANNEL=dev webpack --hide-modules", + "build:dev": "webpack --hide-modules", "build-testing": "cross-env NODE_ENV=development BROWSER=firefox CHANNEL=testing webpack --hide-modules", "build-nightly": "cross-env NODE_ENV=development BROWSER=firefox CHANNEL=nightly webpack --hide-modules", "build-testing-chrome": "cross-env NODE_ENV=development BROWSER=chrome CHANNEL=testing webpack --hide-modules", @@ -16,7 +16,7 @@ "build-chrome:dev": "cross-env NODE_ENV=development BROWSER=chrome 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", - "dev": "concurrently \"cross-env NODE_ENV=development BROWSER=firefox CHANNEL=dev webpack --hide-modules\" \"cross-env NODE_ENV=development BROWSER=chrome CHANNEL=dev webpack --hide-modules\"" + "dev": "cross-env NODE_ENV=development CHANNEL=dev concurrently \"cross-env BROWSER=firefox npm run build:dev -- --watch\" \"cross-env BROWSER=chrome npm run build:dev -- --watch\"" }, "dependencies": { "@types/core-js": "^2.5.0", diff --git a/scripts/build-zip.js b/scripts/build-zip.js index 079af9a..0e319d6 100644 --- a/scripts/build-zip.js +++ b/scripts/build-zip.js @@ -4,8 +4,8 @@ const fs = require('fs'); const path = require('path'); const archiver = require('archiver'); -const extractExtensionData = () => { - const extPackageJson = require('../dist/manifest.json'); +const extractExtensionData = (browserPostfix) => { + const extPackageJson = require(`../dist-${browserPostfix}/manifest.json`); return { name: extPackageJson.name, @@ -39,13 +39,13 @@ const buildZip = (src, dist, zipFilename) => { const main = () => { const browser = process.argv[2]; const testingOrNightly = process.argv[3]; - let distDir; + let browserPostfix; if (browser == 'firefox') { - distDir = '../dist-ff'; + browserPostfix = 'ff'; } else { - distDir = `../dist-${browser}` + browserPostfix = browser; } - const destDir = path.join(__dirname, distDir); + const destDir = path.join(__dirname, `../dist-${browserPostfix}`); const zipDir = path.join(__dirname, '../dist-zip'); const {name, version} = extractExtensionData(); diff --git a/scripts/remove-evals.js b/scripts/remove-evals.js index 10b826b..1ebaf23 100644 --- a/scripts/remove-evals.js +++ b/scripts/remove-evals.js @@ -3,7 +3,7 @@ const path = require('path'); const fs = require('fs'); -const BUNDLE_DIR = path.join(__dirname, '../dist'); +const BUNDLE_DIR = path.join(__dirname, `../dist-${process.env.BROWSER === 'firefox' ? 'ff' : process.env.BROWSER}`); const bundles = [ 'popup/popup.js', 'options/options.js',