Element plus 在vite2 和vue3时build打包失败

报错信息

> vue-tsc --noEmit && vite build

node_modules/element-plus/lib/el-descriptions-item/index.d.ts:2:30 - error TS2307: Cannot find module '../descriptions/src/description-item' or its corresponding type declarations.

2 import DescriptionsItem from '../descriptions/src/description-item';
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/element-plus/lib/el-form/index.d.ts:5:15 - error TS2307: Cannot find module './src/token' or its corresponding type declarations.

5 export * from './src/token';
                ~~~~~~~~~~~~~

node_modules/element-plus/lib/el-form/src/form.vue.d.ts:4:44 - error TS2307: Cannot find module './token' or its corresponding type declarations.

4 import type { ValidateFieldCallback } from './token';
                                             ~~~~~~~~~

node_modules/element-plus/lib/el-row/index.d.ts:1:17 - error TS2307: Cannot find module '../col/src/row' or its corresponding type declarations.

1 import Row from '../col/src/row';
                  ~~~~~~~~~~~~~~~~

node_modules/element-plus/lib/el-table-column/index.d.ts:1:25 - error TS2307: Cannot find module '../table/src/tableColumn' or its corresponding type declarations.

1 import TableColumn from '../table/src/tableColumn';
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 5 errors.

解决方法
在tsconfig.json文件中"compilerOptions"选项下加入

“skipLibCheck”: true

你可能感兴趣的:(vue,javascript,elementui,vue.js,typescript)