Skip to content

Commit

Permalink
fix: separate cjs and mjs typings
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Nov 10, 2023
1 parent 413f433 commit 7d164e0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 2.4.0

- fix: separate cjs and mjs typings

### 2.3.1

- fix for browser usage
Expand Down
5 changes: 5 additions & 0 deletions index.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * as index from './index.js';

export default index.default;

export type HttpBackendOptions = index.HttpBackendOptions;
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type LoadPathOption =

type AddPathOption =
| string
| ((lng: string, namespace: string) => string)
| ((lng: string, namespace: string) => string);

export interface HttpBackendOptions {
/**
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
".": {
"types": {
"require": "./cjs/index.d.ts",
"import": "./esm/index.d.ts"
"import": "./esm/index.d.mts"
},
"module": "./esm/index.js",
"import": "./esm/index.js",
Expand All @@ -29,23 +29,23 @@
"dependencies": {
"cross-fetch": "4.0.0"
},
"types": "./index.d.ts",
"types": "./index.d.mts",
"devDependencies": {
"@babel/cli": "7.23.0",
"@babel/core": "7.23.2",
"@babel/preset-env": "7.23.2",
"@babel/core": "7.23.3",
"@babel/preset-env": "7.23.3",
"babel-plugin-add-module-exports": "1.0.4",
"browserify": "17.0.0",
"dtslint": "4.2.1",
"eslint": "8.52.0",
"eslint": "8.53.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-n": "16.2.0",
"eslint-plugin-n": "16.3.1",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-require-path-exists": "1.1.9",
"eslint-plugin-standard": "5.0.0",
"expect.js": "0.3.1",
"i18next": "23.6.0",
"i18next": "23.7.1",
"json-server": "0.17.4",
"json5": "2.2.3",
"mocha": "10.2.0",
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"strict": true,
"noEmit": true,
"baseUrl": ".",
"paths": { "i18next-http-backend": ["./index.d.ts"] },
"paths": { "i18next-http-backend": ["./index.d.mts"] },

"esModuleInterop": true,
"allowSyntheticDefaultImports": true
},
"include": ["./index.d.ts", "./test/**/*"],
"include": ["./index.d.mts", "./test/**/*"],
"exclude": []
}

0 comments on commit 7d164e0

Please sign in to comment.