You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportfunctioncleanWebPackImports(stringFunc){constwebPackRegex=/[^\s]*(WEBPACK_IMPORTED)(.*?)(\]\)|\])/gconstimportedFunctionRegex=/\[\"(.*?)\"\]/gletcleanedFunc=''constextractedWebpack=Array.from(stringFunc.matchAll(webPackRegex))extractedWebpack.forEach(webPackGarbage=>{constextractedFunction=Array.from(webPackGarbage[0].matchAll(importedFunctionRegex),x=>x[1])cleanedFunc+=stringFunc.replace(webPackGarbage[0],extractedFunction)//TODO find way to call function with string then can dynamically add used imports// let imported = ''// if (webPackRegex.test(window[func] + '')) {// imported = cleanWebPackImports(window[func] + '')// console.log("imported", imported)// cleanedFunc += `${imported} `// }});returncleanedFunc
? cleanedFunc
: stringFunc}