-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix-sourcemap.js
More file actions
24 lines (18 loc) · 765 Bytes
/
Copy pathfix-sourcemap.js
File metadata and controls
24 lines (18 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Path to the problematic file
const filePath = path.join(__dirname, 'node_modules', 'lucide-react', 'dist', 'esm', 'icons', 'puzzle.js');
// Read the file content
try {
let content = fs.readFileSync(filePath, 'utf8');
// Remove the sourcemap reference
content = content.replace(/\/\/# sourceMappingURL=.*$/m, '');
// Write back the content without the sourcemap reference
fs.writeFileSync(filePath, content);
console.log('Successfully removed sourcemap reference from', filePath);
} catch (error) {
console.error('Error fixing sourcemap reference:', error);
}