From 3577fe4c4a4b92c741266678013d1f23fd4c2ff4 Mon Sep 17 00:00:00 2001 From: qwqcode Date: Mon, 18 Dec 2023 21:34:08 +0800 Subject: [PATCH] perf(ui/build): better dts generation --- .github/workflows/test-frontend.yml | 8 ++++---- ui/packages/artalk/package.json | 4 ++-- ui/packages/artalk/vite-base.config.ts | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml index d075c5c43..f83703b5a 100644 --- a/.github/workflows/test-frontend.yml +++ b/.github/workflows/test-frontend.yml @@ -25,16 +25,16 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + with: + version: 9 + - name: Use Node.js ${{ matrix.node }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} cache: pnpm - - uses: pnpm/action-setup@v2 - with: - version: 9 - - name: Install Dependencies run: pnpm --dir ./ui install --frozen-lockfile diff --git a/ui/packages/artalk/package.json b/ui/packages/artalk/package.json index 016c00436..7faf46a61 100644 --- a/ui/packages/artalk/package.json +++ b/ui/packages/artalk/package.json @@ -21,8 +21,8 @@ "unpkg": "./dist/Artalk.iife.js", "jsdelivr": "./dist/Artalk.iife.js", "module": "./dist/Artalk.es.js", - "types": "./dist/src/main.d.ts", - "typings": "./dist/src/main.d.ts", + "types": "./dist/main.d.ts", + "typings": "./dist/main.d.ts", "scripts": { "dev": "vite", "build": "vite build && pnpm build:lite && pnpm build:i18n", diff --git a/ui/packages/artalk/vite-base.config.ts b/ui/packages/artalk/vite-base.config.ts index 4da484344..4b487f62e 100644 --- a/ui/packages/artalk/vite-base.config.ts +++ b/ui/packages/artalk/vite-base.config.ts @@ -29,7 +29,8 @@ export default defineConfig({ }), dts({ // @see https://github.com/qmhc/vite-plugin-dts/blob/main/CHANGELOG.md#breaking-changes - copyDtsFiles: true + copyDtsFiles: true, + rollupTypes: true, }) ], })