Skip to content

引入 Lib 中的 class 无效 #6051

Description

@KaseiHaku

问题描述
import { LibClass } from 'lib';
let aa = new LibClass();

以上代码打包成微信小程序后报错,编译后的代码:
const e=require("../../common/vendor.js")
执行时,报 e 为 undefined 错误

复现步骤
let aa = new LibClass(); 代码位置为小程序分包中,不知道是否有影响

预期结果
不报错,并完成对象 new 操作

实际结果
报错,不是 undefined 就是报 LibClass is not constructor

系统信息:

  • 发行平台: [微信小程序]
  • uni-app版本 ["@dcloudio/uni-app": "3.0.0-5020420260813003",]

补充信息
vendor.js 似乎已经通过 exports.xxx 导出了的,但是不知道为啥不生效

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions