Skip to content

Commit 2735252

Browse files
author
Luca Forstner
authored
fix: Fix regex in source map locating heuristic via sourceMappingURL (#376)
1 parent 1f0df7d commit 2735252

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/bundler-plugin-core/src/debug-id-upload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ async function determineSourceMapPathFromBundle(
295295
logger: Logger
296296
): Promise<string | undefined> {
297297
// 1. try to find source map at `sourceMappingURL` location
298-
const sourceMappingUrlMatch = bundleSource.match(/^\/\/# sourceMappingURL=(.*)$/);
298+
const sourceMappingUrlMatch = bundleSource.match(/^\s*\/\/# sourceMappingURL=(.*)$/m);
299299
if (sourceMappingUrlMatch) {
300300
const sourceMappingUrl = path.normalize(sourceMappingUrlMatch[1] as string);
301301
if (path.isAbsolute(sourceMappingUrl)) {

0 commit comments

Comments
 (0)