From 82001a071df7a5cdfca7c8c6d1a9f0b919afabe5 Mon Sep 17 00:00:00 2001 From: arvinxx Date: Tue, 22 Aug 2023 20:51:49 +0800 Subject: [PATCH] :bug: fix: add cjs support --- .fatherrc.ts | 3 ++- package.json | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.fatherrc.ts b/.fatherrc.ts index 0fe7b22..b90b723 100644 --- a/.fatherrc.ts +++ b/.fatherrc.ts @@ -1,5 +1,6 @@ import { defineConfig } from 'father'; export default defineConfig({ - esm: { output: 'dist' }, + esm: { output: 'es' }, + cjs: { output: 'lib' }, }); diff --git a/package.json b/package.json index d62e04e..e6cc030 100644 --- a/package.json +++ b/package.json @@ -18,11 +18,12 @@ "license": "MIT", "author": "LobeHub ", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.js", - "types": "dist/index.d.ts", + "main": "lib/index.js", + "module": "es/index.js", + "types": "lib/index.d.ts", "files": [ - "dist" + "lib", + "es" ], "scripts": { "build": "father build", @@ -65,6 +66,7 @@ ] }, "dependencies": { + "@babel/runtime": "^7.22.10", "@types/json-schema": "^7.0.12", "zod": "^3.22.2" },