build: 组件打包时排除@vueuse/core、element-plus

This commit is contained in:
peerless_hero
2023-08-30 15:42:47 +08:00
parent 9de80da9e4
commit 82c9337a6d
4 changed files with 8 additions and 22 deletions

View File

@ -1,8 +1,8 @@
/*
* @Author: zhaojinfeng 121016171@qq.com
* @Date: 2023-06-19 10:38:07
* @LastEditors: zhaojinfeng 121016171@qq.com
* @LastEditTime: 2023-07-21 14:47:27
* @LastEditors: peerless_hero peerless_hero@outlook.com
* @LastEditTime: 2023-08-30 15:34:25
* @FilePath: \vue3\bin\build.ts
* @Description:
*
@ -25,6 +25,7 @@ async function buildAComponent(name: string) {
fileName: 'index',
},
rollupOptions: {
external: ['vue', '@vueuse/core', /\.sass/, /element-plus/],
output: [
{
dir: `es/${name}`,

View File

@ -1,6 +1,6 @@
{
"name": "@thzxcx/vue3",
"version": "0.0.1",
"version": "0.1.0",
"license": "MIT",
"repository": {
"type": "git",
@ -38,6 +38,10 @@
"storybook:help": "storybook build -h",
"prepare": "is-ci || husky install"
},
"peerDependencies": {
"@vueuse/core": "*",
"element-plus": "^2.3.9"
},
"dependencies": {
"vue": "^3.2.47"
},

View File

@ -307,7 +307,6 @@ declare module 'vue' {
readonly $shallowRef: UnwrapRef<typeof import('vue/macros')['$shallowRef']>
readonly $toRef: UnwrapRef<typeof import('vue/macros')['$toRef']>
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
readonly computed: UnwrapRef<typeof import('vue')['computed']>
@ -596,7 +595,6 @@ declare module '@vue/runtime-core' {
readonly $shallowRef: UnwrapRef<typeof import('vue/macros')['$shallowRef']>
readonly $toRef: UnwrapRef<typeof import('vue/macros')['$toRef']>
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
readonly computed: UnwrapRef<typeof import('vue')['computed']>

17
types/components.d.ts vendored
View File

@ -11,23 +11,9 @@ declare module 'vue' {
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElButton: typeof import('element-plus/es')['ElButton']
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
ElLink: typeof import('element-plus/es')['ElLink']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSpace: typeof import('element-plus/es')['ElSpace']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTransfer: typeof import('element-plus/es')['ElTransfer']
ElUpload: typeof import('element-plus/es')['ElUpload']
Header: typeof import('./../packages/header/index.vue')['default']
MaskText: typeof import('./../packages/mask-text/index.vue')['default']
PreviewOffice: typeof import('./../packages/preview-office/index.vue')['default']
@ -41,7 +27,4 @@ declare module 'vue' {
UploadSingleFile: typeof import('./../packages/upload-single-file/index.vue')['default']
UploadTable: typeof import('./../packages/upload-table/index.vue')['default']
}
export interface ComponentCustomProperties {
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
}