fix: 修复npm publish推送失败的问题

解决以下问题:
- 修复package.json中repository URL的拼写错误
- 添加缺失的构建依赖项(@rollup/plugin-babel, @babel/core等)
- 修复TypeScript类型定义中的字段名冲突
- 修复JavaScript代码中的import.meta语法错误
- 移除JavaScript文件中不当的类型导出
- 添加缺失的LICENSE文件
- 完善package.json配置(添加browser字段等)

确保项目能够成功构建和发布到npm。

Fixes: npm publish失败问题
Closes: 构建配置优化
This commit is contained in:
2025-12-01 22:49:20 +08:00
parent 6ad59a6ae7
commit 75b25b34f4
7 changed files with 4199 additions and 18 deletions

View File

@@ -97,13 +97,5 @@ export {
serializeError
}
// 导出类型定义
export {
ErrorMonitorOptions,
ErrorType,
ErrorStats,
ErrorInfo
} from './types'
// 导出默认实例(方便直接使用)
export default errorMonitorInstance

View File

@@ -104,7 +104,7 @@ export interface ErrorInfo {
// 小程序错误特有字段
/** 错误对象 */
error?: any
errorObject?: any
/** 页面路径pageNotFound 时) */
path?: string
/** 查询参数pageNotFound 时) */

View File

@@ -141,7 +141,8 @@ export function isProduction() {
// 检查环境变量 MODE
try {
if (typeof import !== 'undefined' && import.meta?.env?.MODE === 'development') {
// 使用 process.env 检测环境变量
if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'development') {
return false
}
} catch (error) {