diff --git a/.fatherrc.ts b/.fatherrc.ts index b90b723..eabaa86 100644 --- a/.fatherrc.ts +++ b/.fatherrc.ts @@ -1,6 +1,6 @@ import { defineConfig } from 'father'; export default defineConfig({ - esm: { output: 'es' }, - cjs: { output: 'lib' }, + esm: {}, + cjs: {}, }); diff --git a/package.json b/package.json index 8c753dd..faca4a5 100644 --- a/package.json +++ b/package.json @@ -24,29 +24,30 @@ "exports": { "./package.json": "./package.json", ".": { - "import": "./es/index.js", - "require": "./lib/index.js", - "default": "./es/index.js", - "types": "./lib/index.d.ts" + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js", + "types": "./dist/cjs/index.d.ts" }, "./react": { - "import": { - "types": "./es/react/index.d.ts", - "default": "./es/react/index.js" - }, - "require": { - "types": "./lib/react/index.d.ts", - "node": "./lib/react/index.js", - "default": "./lib/react/index.js" - } + "types": "./dist/cjs/react.d.ts", + "require": "./dist/cjs/react.js", + "import": "./dist/esm/react.js" + }, + "./*": [ + "./*", + "./*.d.ts" + ] + }, + "typesVersions": { + "*": { + "*": [ + "./*", + "./dist/*" + ] } }, - "main": "lib/index.js", - "module": "es/index.js", - "types": "lib/index.d.ts", "files": [ - "lib", - "es" + "dist" ], "scripts": { "build": "father build", diff --git a/src/react.ts b/src/react.ts index b7504d5..f97dcae 100644 --- a/src/react.ts +++ b/src/react.ts @@ -1,2 +1 @@ -export * from './browser'; -export * from './react'; +export * from './react/index'; diff --git a/src/react/index.ts b/src/react/index.ts index d244b01..0eca4b7 100644 --- a/src/react/index.ts +++ b/src/react/index.ts @@ -1 +1,2 @@ +export * from '../browser'; export * from './useWatchPluginMessage';