aboutsummaryrefslogtreecommitdiffhomepage
path: root/webpack
diff options
context:
space:
mode:
authorAjay <[email protected]>2022-01-14 16:07:24 -0500
committerAjay <[email protected]>2022-01-14 16:07:24 -0500
commita82062da5b7903d4b9f82f4abd02e5daf4a30436 (patch)
treed5ed8d06597bffc242adf6a8815120537a148e8a /webpack
parent35da572f3f5cfecab2b9cea580bcac9f1c14d3a6 (diff)
downloadSponsorBlock-a82062da5b7903d4b9f82f4abd02e5daf4a30436.tar.gz
SponsorBlock-a82062da5b7903d4b9f82f4abd02e5daf4a30436.zip
Add build mode for edge languages
Diffstat (limited to 'webpack')
-rw-r--r--webpack/webpack.common.js21
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());