custom: fix import leak

This commit is contained in:
Alex Gleason
2022-03-03 23:38:59 -06:00
parent afb7827f40
commit 8d64bf2697
2 changed files with 14 additions and 10 deletions

View File

@@ -4,19 +4,12 @@ import { createSelector } from 'reselect';
import gte from 'semver/functions/gte';
import lt from 'semver/functions/lt';
// FIXME: We have to use a dynamic import to trick Webpack into treating it as
// optional, but this causes custom locales to become part of the main chunk.
const importCustom = path => {
try {
return require(`custom/${path}.json`);
} catch(e) {
return {};
}
};
import { custom } from 'soapbox/custom';
// Import custom overrides, if exists
const overrides = importCustom('features');
const overrides = custom('features');
// Truthy array convenience function
const any = arr => arr.some(Boolean);
// For uglification