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 fe790f8 commit c08b5bb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions index.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './index.js'
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,23 @@
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"browser": "./dist/umd/i18nextV4FormatConverter.js",
"types": "./index.d.ts",
"types": "./index.d.mts",
"exports": {
"./package.json": "./package.json",
".": {
"types": {
"require": "./index.d.ts",
"import": "./index.d.mts"
},
"require": "./dist/cjs/index.js",
"default": "./dist/esm/index.js"
},
"./cjs": {
"types": "./index.d.ts",
"default": "./dist/cjs/index.js"
},
"./esm": {
"types": "./index.d.mts",
"default": "./dist/esm/index.js"
},
"./src": {
Expand All @@ -41,7 +47,7 @@
},
"scripts": {
"lint:javascript": "eslint .",
"lint:typescript": "eslint -c .ts.eslintrc *.d.ts test/types/**/*.test-d.ts",
"lint:typescript": "eslint -c .ts.eslintrc *.d.ts *.d.mts test/types/**/*.test-d.ts",
"lint": "npm run lint:javascript && npm run lint:typescript",
"build": "rm -rf dist && rollup -c && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
"test:deno": "deno test test/deno/*.ts --reload --no-check",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"include": [
"/test/types/*.test-d.ts",
"/*.d.ts"
"/*.d.ts",
"/*.d.mts"
]
}

0 comments on commit c08b5bb

Please sign in to comment.