test: fix esm packages

This commit is contained in:
Il Harper 2024-03-13 22:21:27 +08:00
parent 495ede6b53
commit a43066f17b
No known key found for this signature in database
GPG Key ID: 4B71FCA698E7E8EC
2 changed files with 7 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import type { JestConfigWithTsJest } from 'ts-jest'
const config: JestConfigWithTsJest = { const config: JestConfigWithTsJest = {
preset: 'ts-jest/presets/default-esm', preset: 'ts-jest/presets/default-esm',
moduleNameMapper: { moduleNameMapper: {
'@chronocat/red': '@chronocat/red/src',
'^(\\.{1,2}/.*)\\.js$': '$1', '^(\\.{1,2}/.*)\\.js$': '$1',
}, },
transform: { transform: {

View File

@ -14,9 +14,15 @@
"typings": "lib/index.d.ts", "typings": "lib/index.d.ts",
"exports": { "exports": {
".": { ".": {
"default": "./lib/index.js",
"import": "./lib/index.js", "import": "./lib/index.js",
"types": "./lib/index.d.ts" "types": "./lib/index.d.ts"
}, },
"./src": {
"default": "./src/index.ts",
"import": "./src/index.ts",
"types": "./src/index.ts"
},
"./package.json": "./package.json" "./package.json": "./package.json"
}, },
"files": [ "files": [