Skip to content

Commit

Permalink
fix: rm esm
Browse files Browse the repository at this point in the history
ts编译到commonjs的项目似乎不能很好的支持,使用cjs以达到最好的兼容性
  • Loading branch information
aladdin-add committed Aug 31, 2023
1 parent 25d6427 commit 021728a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 84 deletions.
12 changes: 0 additions & 12 deletions lib/axios.js

This file was deleted.

67 changes: 0 additions & 67 deletions lib/jsonb.js

This file was deleted.

2 changes: 1 addition & 1 deletion lib/jsonb.test.js → lib/jsonb.test.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import test from 'node:test'
import { strict as assert } from 'node:assert'
import JSONB from './jsonb.js'
import JSONB from './jsonb.cjs'

test('parse jsonb: obj', () => {
const content = '{ "foo": { "bar": { "value": 12345678901234567890 } } }'
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
},
"license": "MIT",
"author": "唯然<[email protected]",
"type": "module",
"type": "commonjs",
"exports": {
".": {
"import": "./lib/jsonb.js",
"require": "./lib/jsonb.cjs",
"types": "./lib/jsonb.d.ts"
},
"./axios": {
"import": "./lib/axios.js",
"require": "./lib/axios.cjs",
"types": "./lib/axios.d.ts"
}
Expand All @@ -31,7 +29,7 @@
"LICENSE",
"README.md",
"lib",
"!**/*.test.{js,ts}"
"!**/*.test.{mjs,js,ts}"
],
"scripts": {
"lint": "eslint lib",
Expand All @@ -52,6 +50,7 @@
"devDependencies": {
"@eslint/js": "^8.48.0",
"@tsconfig/esm": "^1.0.4",
"@types/node": "^20.5.7",
"eslint": "^8.48.0",
"eslint-plugin-n": "^16.0.2",
"husky": "^8.0.3",
Expand Down

0 comments on commit 021728a

Please sign in to comment.