Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions packages/bundler-plugin-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import componentNameAnnotatePlugin, {
import SentryCli from "@sentry/cli";
import { logger } from "@sentry/utils";
import * as fs from "fs";
import { glob } from "glob";
import { CodeInjection, containsOnlyImports, stripQueryAndHashFromPath } from "./utils";

/**
Expand Down Expand Up @@ -63,19 +62,6 @@ export function shouldSkipCodeInjection(
return false;
}

export function globFiles(outputDir: string): Promise<string[]> {
return glob(
["/**/*.js", "/**/*.mjs", "/**/*.cjs", "/**/*.js.map", "/**/*.mjs.map", "/**/*.cjs.map"].map(
(q) => `${q}?(\\?*)?(#*)`
), // We want to allow query and hashes strings at the end of files
{
root: outputDir,
absolute: true,
nodir: true,
}
);
}

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export function createComponentNameAnnotateHooks(
ignoredComponents: string[],
Expand Down
9 changes: 3 additions & 6 deletions packages/rollup-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
stringToUUID,
COMMENT_USE_STRICT_REGEX,
createDebugIdUploadFunction,
globFiles,
createComponentNameAnnotateHooks,
replaceBooleanFlagsInCode,
CodeInjection,
Expand Down Expand Up @@ -208,15 +207,13 @@ export function _rollupPluginInternal(
if (sourcemapsEnabled && options.sourcemaps?.disable !== "disable-upload") {
if (outputOptions.dir) {
const outputDir = outputOptions.dir;
const buildArtifacts = await globFiles(outputDir);
const buildArtifacts = Object.keys(bundle).map((asset) => path.join(outputDir, asset));
await upload(buildArtifacts);
} else if (outputOptions.file) {
await upload([outputOptions.file]);
} else {
const buildArtifacts = Object.keys(bundle).map((asset) =>
path.join(path.resolve(), asset)
);
await upload(buildArtifacts);
// The Rollup options say that either "dir" or "file" must be specified
logger.warn('Either "dir" or "file" output option must be specified. Skipping upload.');
}
}
} finally {
Expand Down
Loading