We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa20a31 commit 22e5b7aCopy full SHA for 22e5b7a
packages/remix/scripts/deleteSourcemaps.js
@@ -2,17 +2,18 @@
2
const fs = require('fs');
3
const path = require('path');
4
5
+const glob = require('glob');
6
+
7
function deleteSourcemaps(buildPath) {
8
console.info(`[sentry] Deleting sourcemaps from ${buildPath}`);
9
- const files = fs.readdirSync(buildPath);
10
+ // Delete all .map files in the build folder and its subfolders
11
+ const mapFiles = glob.sync('**/*.map', { cwd: buildPath });
12
- files.forEach(file => {
- if (file.endsWith('.map')) {
- fs.unlinkSync(path.join(buildPath, file));
13
+ mapFiles.forEach(file => {
14
+ fs.unlinkSync(path.join(buildPath, file));
15
- console.info(`[sentry] Deleted ${file}`);
- }
16
+ console.info(`[sentry] Deleted ${file}`);
17
});
18
}
19
0 commit comments