Skip to content

Commit

Permalink
refactor!: esm only
Browse files Browse the repository at this point in the history
  • Loading branch information
Lmmmmmm-bb committed May 2, 2023
1 parent 8f74755 commit 9f43dc4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { SemiContextMenu } from './SemiContextMenu';
export { SemiContextMenuProps } from './interface';
export type { SemiContextMenuProps } from './interface';
6 changes: 6 additions & 0 deletions src/interface.d.ts
Original file line number Diff line number Diff line change
@@ -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;
6 changes: 0 additions & 6 deletions src/interface.ts

This file was deleted.

2 changes: 1 addition & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export default defineConfig({
treeshake: true,
splitting: true,
entry: ['./src/index.ts'],
format: ['cjs', 'esm'],
format: ['esm'],
esbuildPlugins: [ScssModulesPlugin()],
});

0 comments on commit 9f43dc4

Please sign in to comment.