Skip to content

Commit 8eaa35a

Browse files
committed
refactor: update files to realize tree-shaking feature
1 parent 26a31b2 commit 8eaa35a

5 files changed

Lines changed: 17 additions & 11 deletions

File tree

docs/.island/theme/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
NotFoundLayout,
77
setup,
88
} from 'islandjs/theme'
9-
import 'echo-ui/dist/style.css'
9+
import '../../../packages/index.css'
1010

1111
const Banner = () => {
1212
return (

package.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nafr/echo-ui",
3-
"version": "0.0.2",
3+
"version": "0.0.8",
44
"description": "A UI library born for WAA",
55
"keywords": [
66
"echo-ui",
@@ -18,8 +18,12 @@
1818
"license": "MIT",
1919
"type": "module",
2020
"main": "dist/echo-ui.umd.cjs",
21-
"module": "dist/echo-ui.js",
21+
"module": "dist/packages/main.js",
2222
"types": "dist/types/packages/main.d.ts",
23+
"sideEffects": false,
24+
"files": [
25+
"dist"
26+
],
2327
"scripts": {
2428
"build": "vite build && tsc",
2529
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
@@ -32,9 +36,6 @@
3236
"build:docs-wins": "island build docs && copy .\\docs\\.island\\index.html .\\docs\\.island\\dist\\",
3337
"preview:docs": "island start docs"
3438
},
35-
"files": [
36-
"dist"
37-
],
3839
"devDependencies": {
3940
"@nextui-org/react": "^2.2.9",
4041
"@testing-library/react": "^14.1.2",
@@ -71,6 +72,13 @@
7172
"vite": "^5.0.12",
7273
"vitest": "^1.0.4"
7374
},
75+
"dependencies": {
76+
"clsx": "^2.0.0",
77+
"d3": "^7.8.5",
78+
"tailwind-merge": "^2.0.0",
79+
"tailwind-variants": "^0.1.19",
80+
"tone": "^14.7.77"
81+
},
7482
"peerDependencies": {
7583
"react": "^18.2.0",
7684
"react-dom": "^18.2.0"

packages/lib/log.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { version } from '../../package.json'
2-
import { __DEV__ } from './assertion'
32

43
const PREFIX = 'Echo UI:'
54

@@ -10,8 +9,6 @@ export const logger = {
109
}
1110

1211
export const logBrand = () => {
13-
if (!__DEV__) return
14-
1512
const content = `%c > Echo UI v${version} prod by leyoonafr < `
1613
window.onload = () => {
1714
console.log(content, 'background: #ffbe3b; color: #000')

packages/main.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ export type {
9191
UseWaveformProps,
9292
} from './hooks'
9393

94-
import './index.css'
95-
9694
import('./lib/log').then(({ logBrand }) => {
9795
logBrand()
9896
})

vite.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export default defineConfig({
1616
name: 'echo-ui',
1717
},
1818
rollupOptions: {
19+
output: {
20+
esModule: true,
21+
},
1922
external: ['react', 'react-dom'],
2023
},
2124
},

0 commit comments

Comments
 (0)