From 600f3ddf5a1f6b17a55557837cba2c131a25b133 Mon Sep 17 00:00:00 2001 From: tyh2001 <1469442737@qq.com> Date: Mon, 8 Aug 2022 17:45:42 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E6=9B=B4=E6=96=B0=E6=89=93=E5=8C=85?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=20=F0=9F=A6=9A=F0=9F=A6=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - .../_interface/button.d.ts | 2 ++ .../fighting-components/_interface/image.d.ts | 2 ++ .../_interface/watermark.d.ts | 2 +- packages/fighting-components/components.d.ts | 4 +--- .../message/src/interface.d.ts | 1 + pnpm-lock.yaml | 2 -- start/main.ts | 4 ++-- vite.config.lib.ts | 23 ++++++++----------- vite.config.ts | 23 ++++++++----------- vite.config.umd.ts | 6 ----- 11 files changed, 27 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index dfc1e439ad..42dcad25ef 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "@fighting-design/fighting-components": "workspace:*", "@fighting-design/fighting-theme": "workspace:*", "@vitejs/plugin-vue": "^2.3.1", - "@vue/runtime-core": "^3.2.37", "@vue/test-utils": "^2.0.0-rc.18", "commitizen": "^4.2.4", "cz-conventional-changelog": "^3.3.0", diff --git a/packages/fighting-components/_interface/button.d.ts b/packages/fighting-components/_interface/button.d.ts index c9560244ab..175257320e 100644 --- a/packages/fighting-components/_interface/button.d.ts +++ b/packages/fighting-components/_interface/button.d.ts @@ -1,3 +1,5 @@ +import type { buttonType } from '../button/src/interface' + export interface RipplesInterface { evt: buttonEventInterface node: HTMLElement diff --git a/packages/fighting-components/_interface/image.d.ts b/packages/fighting-components/_interface/image.d.ts index 37e202a5a3..545f8efbf1 100644 --- a/packages/fighting-components/_interface/image.d.ts +++ b/packages/fighting-components/_interface/image.d.ts @@ -1,3 +1,5 @@ +import type { imageFit } from '../image/src/interface' + export interface LazyInterface { observer(): IntersectionObserver lazyCreateImg(): void diff --git a/packages/fighting-components/_interface/watermark.d.ts b/packages/fighting-components/_interface/watermark.d.ts index 9788b5ecaf..49b4d05627 100644 --- a/packages/fighting-components/_interface/watermark.d.ts +++ b/packages/fighting-components/_interface/watermark.d.ts @@ -1,6 +1,6 @@ export interface createBase64Interface { ( - content = '', + content: string, width: number, height: number, fontSize: string, diff --git a/packages/fighting-components/components.d.ts b/packages/fighting-components/components.d.ts index 2a489eb9ea..86f3be872a 100644 --- a/packages/fighting-components/components.d.ts +++ b/packages/fighting-components/components.d.ts @@ -1,6 +1,4 @@ -import '@vue/runtime-core' - -declare module '@vue/runtime-core' { +declare module 'vue' { export interface GlobalComponents { FButton: typeof import('./button/src/button.vue')['default'] FButtonGroup: typeof import('./button-group/src/button-group.vue')['default'] diff --git a/packages/fighting-components/message/src/interface.d.ts b/packages/fighting-components/message/src/interface.d.ts index 70c85f8ea6..3a8aec53e4 100644 --- a/packages/fighting-components/message/src/interface.d.ts +++ b/packages/fighting-components/message/src/interface.d.ts @@ -1,3 +1,4 @@ +import type { Props } from './message' import type { ExtractPropTypes, ComponentInternalInstance } from 'vue' export interface FMessageInstance { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2b7a7536af..c0dcaa75d3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,6 @@ importers: '@types/node': ^17.0.42 '@typescript-eslint/parser': ^5.28.0 '@vitejs/plugin-vue': ^2.3.1 - '@vue/runtime-core': ^3.2.37 '@vue/test-utils': ^2.0.0-rc.18 commitizen: ^4.2.4 cz-conventional-changelog: ^3.3.0 @@ -40,7 +39,6 @@ importers: '@fighting-design/fighting-components': link:packages/fighting-components '@fighting-design/fighting-theme': link:packages/fighting-theme '@vitejs/plugin-vue': 2.3.3_vite@3.0.4+vue@3.2.37 - '@vue/runtime-core': 3.2.37 '@vue/test-utils': 2.0.2_vue@3.2.37 commitizen: 4.2.5 cz-conventional-changelog: 3.3.0 diff --git a/start/main.ts b/start/main.ts index c2948dc83a..a4e5dc504e 100644 --- a/start/main.ts +++ b/start/main.ts @@ -2,11 +2,11 @@ import { createApp } from 'vue' import App from './src/App.vue' // 开发阶段引入 -import FightingDesign from '@fighting-design/fighting-components' +// import FightingDesign from '@fighting-design/fighting-components' import '@fighting-design/fighting-theme' // 打包阶段引入 -// import FightingDesign from '../dist' +import FightingDesign from '../dist' // import '../dist/dist/style.css' console.log(FightingDesign) diff --git a/vite.config.lib.ts b/vite.config.lib.ts index a30b6759ca..bac78ed7e8 100644 --- a/vite.config.lib.ts +++ b/vite.config.lib.ts @@ -25,25 +25,20 @@ export default (): UserConfigExport => { rollupOptions: { external: ['vue'], input, - output: [ - { - format: 'cjs', - dir: 'dist/lib', - entryFileNames: '[name].js', - preserveModules: true, - preserveModulesRoot: 'components' + output: { + format: 'cjs', + dir: 'dist/lib', + entryFileNames: '[name].js', + preserveModules: true, + preserveModulesRoot: 'components', + globals: { + vue: 'Vue' } - ] + } }, lib: { entry: input, formats: ['cjs'] - }, - terserOptions: { - compress: { - drop_console: true, - drop_debugger: true - } } }, plugins: [ diff --git a/vite.config.ts b/vite.config.ts index a335d5ad5c..7a07df1e06 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -25,25 +25,20 @@ export default (): UserConfigExport => { rollupOptions: { external: ['vue'], // 忽略打包vue文件 input, - output: [ - { - format: 'es', - dir: 'dist/es', - entryFileNames: '[name].js', - preserveModules: true, // 让打包目录和我们目录对应 - preserveModulesRoot: 'components' // 配置打包根目录 + output: { + format: 'es', + dir: 'dist/es', + entryFileNames: '[name].js', + preserveModules: true, // 让打包目录和我们目录对应 + preserveModulesRoot: 'components', // 配置打包根目录 + globals: { + vue: 'Vue' } - ] + } }, lib: { entry: input, formats: ['es'] - }, - terserOptions: { - compress: { - drop_console: true, - drop_debugger: true - } } }, plugins: [ diff --git a/vite.config.umd.ts b/vite.config.umd.ts index a3e460ed0e..a92ff3436b 100644 --- a/vite.config.umd.ts +++ b/vite.config.umd.ts @@ -24,12 +24,6 @@ export default (): UserConfigExport => { vue: 'Vue' } } - }, - terserOptions: { - compress: { - drop_console: true, - drop_debugger: true - } } } }