importHelpers Cannot find module 'tslib'

  • Creator 版本: 2.4.4

  • 目标平台:原生平台

  • TS 项目

  • 重现方式:

  1. 启用 "importHelpers": true,
  2. 加载远程 bundle 立马报错 ERROR: Uncaught Error: Cannot find module 'tslib', location: assets/main/index.xxxxx.js:0:0

通过 STACK 可以看到 在远程包中有 require(‘tslib’) 执行, 然后在 main bundle中 报错。
通过查看生成的 bundle下的 index.xxxx.js 文件发现

image
未定义!
而 main bundle 下的 index.xxxx.js tslib 正常有定义
image
这是 引擎的 的bug? 要怎么解决?

@jare @panda

bundle中的脚本不能直接引用

已经解决了, 可以相互引用。 需要该编译脚本。

该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。