Skip to content

Commit 6ca1d74

Browse files
committed
feat: Remove glob dependency
1 parent 144e922 commit 6ca1d74

File tree

4 files changed

+3
-29
lines changed

4 files changed

+3
-29
lines changed

packages/bundler-plugin-core/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"@sentry/cli": "^2.57.0",
5858
"dotenv": "^16.3.1",
5959
"find-up": "^5.0.0",
60-
"glob": "^10.5.0",
6160
"magic-string": "0.30.8"
6261
},
6362
"devDependencies": {

packages/bundler-plugin-core/src/index.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import componentNameAnnotatePlugin, {
55
import SentryCli from "@sentry/cli";
66
import { logger } from "@sentry/utils";
77
import * as fs from "fs";
8-
import { glob } from "glob";
98
import { CodeInjection, containsOnlyImports, stripQueryAndHashFromPath } from "./utils";
109

1110
/**
@@ -63,19 +62,6 @@ export function shouldSkipCodeInjection(
6362
return false;
6463
}
6564

66-
export function globFiles(outputDir: string): Promise<string[]> {
67-
return glob(
68-
["/**/*.js", "/**/*.mjs", "/**/*.cjs", "/**/*.js.map", "/**/*.mjs.map", "/**/*.cjs.map"].map(
69-
(q) => `${q}?(\\?*)?(#*)`
70-
), // We want to allow query and hashes strings at the end of files
71-
{
72-
root: outputDir,
73-
absolute: true,
74-
nodir: true,
75-
}
76-
);
77-
}
78-
7965
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
8066
export function createComponentNameAnnotateHooks(
8167
ignoredComponents: string[],

packages/rollup-plugin/src/index.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
stringToUUID,
1010
COMMENT_USE_STRICT_REGEX,
1111
createDebugIdUploadFunction,
12-
globFiles,
1312
createComponentNameAnnotateHooks,
1413
replaceBooleanFlagsInCode,
1514
CodeInjection,
@@ -206,18 +205,8 @@ export function _rollupPluginInternal(
206205
await sentryBuildPluginManager.createRelease();
207206

208207
if (sourcemapsEnabled && options.sourcemaps?.disable !== "disable-upload") {
209-
if (outputOptions.dir) {
210-
const outputDir = outputOptions.dir;
211-
const buildArtifacts = await globFiles(outputDir);
212-
await upload(buildArtifacts);
213-
} else if (outputOptions.file) {
214-
await upload([outputOptions.file]);
215-
} else {
216-
const buildArtifacts = Object.keys(bundle).map((asset) =>
217-
path.join(path.resolve(), asset)
218-
);
219-
await upload(buildArtifacts);
220-
}
208+
const buildArtifacts = Object.keys(bundle).map((asset) => path.join(path.resolve(), asset));
209+
await upload(buildArtifacts);
221210
}
222211
} finally {
223212
freeGlobalDependencyOnBuildArtifacts();

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7164,7 +7164,7 @@ glob@8.0.3:
71647164
minimatch "^5.0.1"
71657165
once "^1.3.0"
71667166

7167-
glob@^10.2.2, glob@^10.5.0:
7167+
glob@^10.2.2:
71687168
version "10.5.0"
71697169
resolved "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz#8ec0355919cd3338c28428a23d4f24ecc5fe738c"
71707170
integrity sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==

0 commit comments

Comments
 (0)