Skip to content

Commit 633aeeb

Browse files
authored
fix: js file extension maybe .cjs or .mjs (#4229)
1 parent 2fc4050 commit 633aeeb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/retry-plugin/src/fetch-retry.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ import { getRetryUrl, combineUrlDomainWithPathQuery } from './utils';
1212
function autoParseResponse(url: string, response: Response) {
1313
try {
1414
const parsed = new URL(url);
15-
if (parsed.pathname.endsWith('.js')) {
15+
if (
16+
parsed.pathname.endsWith('.js') ||
17+
parsed.pathname.endsWith('.cjs') ||
18+
parsed.pathname.endsWith('.mjs')
19+
) {
1620
return response.text();
1721
}
1822
return response.json();

0 commit comments

Comments
 (0)