Skip to content

Commit

Permalink
Recover CommonJS support
Browse files Browse the repository at this point in the history
Keep compatibility with CommonJS applications.
  • Loading branch information
orgads committed Jun 13, 2024
1 parent 1401ac7 commit 62b0eef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"name": "retry-axios",
"version": "0.0.0",
"description": "Retry HTTP requests with Axios.",
"exports": "./build/src/index.js",
"type": "module",
"type": "commonjs",
"source": "src/index.ts",
"main": "./build/src/index.js",
"types": "./build/src/index.d.ts",
"engines": {
"node": ">=18"
Expand Down
6 changes: 3 additions & 3 deletions test/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import assert from 'node:assert';
import process from 'node:process';
import assert from 'assert';

Check failure on line 1 in test/index.ts

View workflow job for this annotation

GitHub Actions / lint

Prefer `node:assert` over `assert`.
import process from 'process';

Check failure on line 2 in test/index.ts

View workflow job for this annotation

GitHub Actions / lint

Prefer `node:process` over `process`.
import axios, {type AxiosError, type AxiosRequestConfig} from 'axios';
import nock from 'nock';
import * as sinon from 'sinon';
import sinon from 'sinon';
import {describe, it, afterEach} from 'mocha';
import * as rax from '../src/index.js';
import {type RaxConfig} from '../src/index.js';
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"rootDir": ".",
"outDir": "build",
"moduleResolution": "node",
"module": "ES2022",
"module": "CommonJS",
"esModuleInterop": true
},
"include": [
Expand Down

0 comments on commit 62b0eef

Please sign in to comment.