diff options
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | webpack/webpack.common.js | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/package.json b/package.json index 740ab7a1..3801193a 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "build:chrome": "webpack --env.browser=chrome --config webpack/webpack.prod.js", "build:firefox": "webpack --env.browser=firefox --config webpack/webpack.prod.js", "build:safari": "webpack --env.browser=safari --config webpack/webpack.prod.js", + "build:edge": "webpack --env.browser=edge --config webpack/webpack.prod.js", "build:dev": "npm run build:dev:chrome", "build:dev:chrome": "webpack --env.browser=chrome --config webpack/webpack.dev.js", "build:dev:firefox": "webpack --env.browser=firefox --config webpack/webpack.dev.js", diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index 7f0d64ac..cacb07ba 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -5,6 +5,22 @@ const BuildManifest = require('./webpack.manifest'); const srcDir = '../src/'; const fs = require("fs"); +const edgeLanguages = [ + "de", + "en", + "es", + "fr", + "pl", + "pt_BR", + "ro", + "ru", + "sk", + "sv", + "tr", + "uk", + "zh_CN" +] + module.exports = env => ({ entry: { popup: path.join(__dirname, srcDir + 'popup.ts'), @@ -49,6 +65,11 @@ module.exports = env => ({ context: './public', filter: async (path) => { if (path.match(/\/_locales\/.+/)) { + if (env.browser.toLowerCase() === "edge" + && !edgeLanguages.includes(path.match(/(?<=\/_locales\/)[^/]+(?=\/[^/]+$)/)[0])) { + return false; + } + const data = await fs.promises.readFile(path); const parsed = JSON.parse(data.toString()); |