From a43066f17b66a54d7f1761374254a7f4caea6d9e Mon Sep 17 00:00:00 2001 From: Il Harper Date: Wed, 13 Mar 2024 22:21:27 +0800 Subject: [PATCH] test: fix esm packages --- jest.config.ts | 1 + packages/red/package.json | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/jest.config.ts b/jest.config.ts index c65fecd..b2c54fc 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -3,6 +3,7 @@ import type { JestConfigWithTsJest } from 'ts-jest' const config: JestConfigWithTsJest = { preset: 'ts-jest/presets/default-esm', moduleNameMapper: { + '@chronocat/red': '@chronocat/red/src', '^(\\.{1,2}/.*)\\.js$': '$1', }, transform: { diff --git a/packages/red/package.json b/packages/red/package.json index 0c3417d..3763bd5 100644 --- a/packages/red/package.json +++ b/packages/red/package.json @@ -14,9 +14,15 @@ "typings": "lib/index.d.ts", "exports": { ".": { + "default": "./lib/index.js", "import": "./lib/index.js", "types": "./lib/index.d.ts" }, + "./src": { + "default": "./src/index.ts", + "import": "./src/index.ts", + "types": "./src/index.ts" + }, "./package.json": "./package.json" }, "files": [