[PCCompatCheck] Add module.exports ignoring

This commit is contained in:
Ducko 2021-06-07 19:00:48 +01:00 committed by Alyxia Sother
parent e2f529d7fc
commit 2db8ae01c4
No known key found for this signature in database
GPG Key ID: 355968D14144B739
1 changed files with 3 additions and 2 deletions

View File

@ -56,9 +56,10 @@ for (const jsFile of glob.sync(`${cloneDir}/**/*.js`).concat(glob.sync(`${cloneD
for (let imp of imports.split(',')) {
imp = imp.trim().split(':')[0];
const searchRegex = new RegExp(`^export.*${imp}.*$`, 'gm');
const searchRegex1 = new RegExp(`^export.*${imp}.*$`, 'gm');
const searchRegex2 = new RegExp(`^ *${imp}: `, 'gm');
const searchMatch = aliasJS.match(searchRegex);
const searchMatch = aliasJS.match(searchRegex1) || aliasJS.match(searchRegex2);
if (!searchMatch) {
if (requirePath === 'powercord/webpack') {