fix(build): 修复打包过程中的依赖和导入错误
- 安装缺失的 sass 依赖解决预处理器报错问题 - 安装 element-plus 组件库依赖,修复相关页面构建失败 - 修正 customerLead 页面错误导入的 listUser 为 listUsers - 确认修复后 pnpm build 成功,产物正常生成 - 更新 package.json 和 pnpm-lock.yaml,引入新依赖并锁定版本
This commit is contained in:
@@ -21,4 +21,18 @@
|
||||
### 验证
|
||||
- 所有 import 符号在 mp-vue 中均存在(`@/router`、`QrCodeStatusResponse`、`QrLogin` 组件、`configWebsiteField` 等)。
|
||||
- 两边 `User` 模型字段一致(含 `isSuperAdmin`、`templateId`),表单初值与 `LoginForm` 类型匹配。
|
||||
- 已触发 `vue-tsc --noEmit` 全量类型检查(后台任务)确认无编译错误。
|
||||
- 全量类型检查(`vue-tsc --noEmit`)报 1178 个错误,但均出现在我未改动的文件(如 system/cache、house、shop/shopGoods 等),我改动的 4 个文件均未出现在错误列表中。
|
||||
- 实际构建 `pnpm build` 已通过。
|
||||
|
||||
## 修复打包报错(sass / element-plus / listUser)
|
||||
|
||||
用户反馈打包报错 `Preprocessor dependency "sass" not found`,逐步修复如下:
|
||||
|
||||
1. 安装 `sass` 作为 devDependency:`pnpm add -D sass`。
|
||||
2. 继续构建发现 `element-plus` 未安装(`src/views/cms/customerLead/index.vue` 与 `src/views/cms/recommendation/index.vue` 均导入)。执行 `pnpm add element-plus`,安装到 dependencies(版本 2.14.3)。
|
||||
3. 继续构建发现 `customerLead/index.vue` 中导入 `listUser`(拼写错误),实际 API 导出为 `listUsers`。修正导入和调用处。
|
||||
4. 最终 `pnpm build` 成功完成(`✓ 9738 modules transformed`,`dist` 产物正常生成)。
|
||||
|
||||
### 本次修复涉及文件
|
||||
- `package.json` / `pnpm-lock.yaml` / `node_modules`(新增 `sass`、`element-plus` 及 `@typescript-eslint/eslint-plugin` 等依赖)
|
||||
- `src/views/cms/customerLead/index.vue`(`listUser` → `listUsers`)
|
||||
|
||||
Reference in New Issue
Block a user