diff --git a/desktop/plugins/public/reactdevtools/scripts/remove-sourcemap-reference.tsx b/desktop/plugins/public/reactdevtools/scripts/remove-sourcemap-reference.tsx index 0901d07ce..8641083fc 100644 --- a/desktop/plugins/public/reactdevtools/scripts/remove-sourcemap-reference.tsx +++ b/desktop/plugins/public/reactdevtools/scripts/remove-sourcemap-reference.tsx @@ -22,14 +22,6 @@ import path from 'path'; const SOURCEMAP_REFERENCE = '//# sourceMappingURL=importFile.worker.worker.js.map'; -// Remove this once we're upgrade to a newer JS version. String.prototype.replaceAll is a thing. -function replaceAll(s: string, find: string, replace: string): string { - return s.replace( - new RegExp(find.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'g'), - replace, - ); -} - async function main() { const frontendPath = path.resolve( __dirname, @@ -48,10 +40,7 @@ async function main() { return 0; } - await fs.writeFile( - frontendPath, - replaceAll(content, SOURCEMAP_REFERENCE, ''), - ); + await fs.writeFile(frontendPath, content.replaceAll(SOURCEMAP_REFERENCE, '')); console.log('react-devtools-inline patched successfully.'); return 0; diff --git a/desktop/plugins/public/reactdevtools/scripts/tsconfig.json b/desktop/plugins/public/reactdevtools/scripts/tsconfig.json index 7d5fb90c4..a8d67065a 100644 --- a/desktop/plugins/public/reactdevtools/scripts/tsconfig.json +++ b/desktop/plugins/public/reactdevtools/scripts/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES2017", + "target": "ES2021", "module": "nodenext", "jsx": "react", "noEmit": true, @@ -9,4 +9,3 @@ "esModuleInterop": true } } -