diff --git a/package.json b/package.json index b4ea977..8fc9e92 100644 --- a/package.json +++ b/package.json @@ -28,19 +28,20 @@ ], "exports": { ".": { - "require": "./dist/index.cjs", "import": "./dist/index.js" } }, - "main": "dist/index.cjs", "module": "dist/index.js", "types": "dist/index.d.ts", "files": [ "dist" ], + "engines": { + "node": ">=14.6" + }, "scripts": { "dev": "pnpm style:watch & tsup --watch", - "playground": "vite playground --host & pnpm style:watch", + "play": "vite playground --host & pnpm style:watch", "build": "tsup", "build:playground": "vite build playground", "lint": "eslint . --fix", diff --git a/src/index.ts b/src/index.ts index 0e158f0..1a74d88 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,2 +1,2 @@ export { SemiContextMenu } from './SemiContextMenu'; -export { SemiContextMenuProps } from './interface'; +export type { SemiContextMenuProps } from './interface'; diff --git a/src/interface.d.ts b/src/interface.d.ts new file mode 100644 index 0000000..d79f960 --- /dev/null +++ b/src/interface.d.ts @@ -0,0 +1,6 @@ +import type { MouseEvent as ReactMouseEvent } from 'react'; +import type { DropdownProps } from '@douyinfe/semi-ui/lib/es/dropdown'; + +export type SemiContextMenuProps = DropdownProps; + +export type MouseEventType = ReactMouseEvent | MouseEvent; diff --git a/src/interface.ts b/src/interface.ts deleted file mode 100644 index 41401d1..0000000 --- a/src/interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { type MouseEvent as ReactMouseEvent } from 'react'; -import { type DropdownProps } from '@douyinfe/semi-ui/lib/es/dropdown'; - -export type SemiContextMenuProps = DropdownProps; - -export type MouseEventType = ReactMouseEvent | MouseEvent; diff --git a/tsup.config.ts b/tsup.config.ts index d6c1658..5cc5ed2 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -8,6 +8,6 @@ export default defineConfig({ treeshake: true, splitting: true, entry: ['./src/index.ts'], - format: ['cjs', 'esm'], + format: ['esm'], esbuildPlugins: [ScssModulesPlugin()], });