Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vue): fix generate type declaration #66

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tidbcloud/tisqleditor-vue",
"version": "0.0.2",
"version": "0.0.3",
"description": "tisqleditor vue component",
"type": "module",
"main": "dist/index.js",
Expand All @@ -13,7 +13,7 @@
"CHANGELOG.md"
],
"scripts": {
"build": "vue-tsc -b && vite build"
"build": "vite build && vue-tsc -b"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vue-tsc -b generate type declaration in the dist folder, but vite build deletes the dist folder and re-create it, so we need to run vite build first, else we can't get the type declaration files.

},
"keywords": [
"tidbcloud",
Expand All @@ -31,7 +31,6 @@
"@vitejs/plugin-vue": "^5.0.5",
"typescript": "^5.2.2",
"vite": "^5.3.4",
"vite-plugin-dts": "4.0.0-beta.1",
"vue": "^3.4.31",
"vue-tsc": "^2.0.24"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/vue/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import dts from 'vite-plugin-dts'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because vue-tsc -b will get type declaration, so we don't need dts plugin.


export default defineConfig({
plugins: [vue(), dts()],
plugins: [vue()],
build: {
lib: {
entry: 'src/index.ts',
Expand Down
Loading