Skip to content

Commit 1a61872

Browse files
author
Luca Forstner
authored
fix(core): Also do debug ID injection for .cjs files (#203)
1 parent 702e834 commit 1a61872

File tree

1 file changed

+3
-3
lines changed
  • packages/bundler-plugin-core/src

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ const unplugin = createUnplugin<Options>((options, unpluginMetaContext) => {
315315
nodir: true,
316316
ignore: internalOptions._experiments.debugIdUpload.ignore,
317317
})
318-
).filter((p) => p.endsWith(".js") || p.endsWith(".mjs"));
318+
).filter((p) => p.endsWith(".js") || p.endsWith(".mjs") || p.endsWith(".cjs"));
319319

320320
const sourceFileUploadFolderPromise = util.promisify(fs.mkdtemp)(
321321
path.join(os.tmpdir(), "sentry-bundler-plugin-upload-")
@@ -373,7 +373,7 @@ const unplugin = createUnplugin<Options>((options, unpluginMetaContext) => {
373373
renderChunk(code, chunk) {
374374
if (
375375
options._experiments?.debugIdUpload &&
376-
[".js", ".mjs"].some((ending) => chunk.fileName.endsWith(ending)) // chunks could be any file (html, md, ...)
376+
[".js", ".mjs", ".cjs"].some((ending) => chunk.fileName.endsWith(ending)) // chunks could be any file (html, md, ...)
377377
) {
378378
return injectDebugIdSnippetIntoChunk(code);
379379
} else {
@@ -385,7 +385,7 @@ const unplugin = createUnplugin<Options>((options, unpluginMetaContext) => {
385385
renderChunk(code, chunk) {
386386
if (
387387
options._experiments?.debugIdUpload &&
388-
[".js", ".mjs"].some((ending) => chunk.fileName.endsWith(ending)) // chunks could be any file (html, md, ...)
388+
[".js", ".mjs", ".cjs"].some((ending) => chunk.fileName.endsWith(ending)) // chunks could be any file (html, md, ...)
389389
) {
390390
return injectDebugIdSnippetIntoChunk(code);
391391
} else {

0 commit comments

Comments
 (0)