diff options
author | Ajay <[email protected]> | 2022-01-14 16:07:24 -0500 |
---|---|---|
committer | Ajay <[email protected]> | 2022-01-14 16:07:24 -0500 |
commit | a82062da5b7903d4b9f82f4abd02e5daf4a30436 (patch) | |
tree | d5ed8d06597bffc242adf6a8815120537a148e8a /webpack/webpack.common.js | |
parent | 35da572f3f5cfecab2b9cea580bcac9f1c14d3a6 (diff) | |
download | SponsorBlock-a82062da5b7903d4b9f82f4abd02e5daf4a30436.tar.gz SponsorBlock-a82062da5b7903d4b9f82f4abd02e5daf4a30436.zip |
Add build mode for edge languages
Diffstat (limited to 'webpack/webpack.common.js')
-rw-r--r-- | webpack/webpack.common.js | 21 |
1 files changed, 21 insertions, 0 deletions
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()); |