2.4.2发布后有脚本引用问题,求原因

Creator 版本:2.4.2
平台:web, 安卓

index.653e0.js:11 Uncaught Error: Cannot find module ‘readline’
at s (index.653e0.js:11)
at index.653e0.js:20
at Errors.ts:22
at Errors.ts:22
at Object. (Errors.ts:22)
at Object.window.__require.7…/algo (Errors.ts:22)
at s (index.653e0.js:18)
at index.653e0.js:20
at Object.window.__require.GameLogic…/gutils (GameLogic.ts:2)
at s (index.653e0.js:18)
s @ index.653e0.js:11
(anonymous) @ index.653e0.js:20
(anonymous) @ Errors.ts:22
(anonymous) @ Errors.ts:22
(anonymous) @ Errors.ts:22
window.__require.7…/algo @ Errors.ts:22
s @ index.653e0.js:18
(anonymous) @ index.653e0.js:20
window.__require.GameLogic…/gutils @ GameLogic.ts:2
s @ index.653e0.js:18
(anonymous) @ index.653e0.js:20
window.__require.Game…/common/Errors @ Game.ts:4
s @ index.653e0.js:18
e @ index.653e0.js:26
(anonymous) @ index.653e0.js:28
index.89c3e.js:11 Uncaught Error: Cannot find module ‘…/…/prefabs/pb_DecorationItem’
at s (index.89c3e.js:11)
at index.89c3e.js:20
at Object.window.__require.ui_decorations…/…/common/Game (ui_decorations.ts:12)
at s (index.89c3e.js:18)
at e (index.89c3e.js:26)
at index.89c3e.js:28

在编辑器调试是正常的,一旦发布就出现了这个require问题,
项目是使用typescript写的
我在想是不是因为2.4版本包的机制,脚本不能放在resource文件夹中

感觉现在如果Resource文件夹中的脚本引用外包的ts, 由于路径原因会直接找不到

看看是不是 你项目 类库 勾选的 不够,你全部勾上 试一下,然后再 去掉那些你不需要的

确定是resource目录中的脚本引用不到外部的非组件脚本
这样的话最好resource目录里面不要放入脚本

但是这个感觉还是有点奇怪,和以前的用法不兼容了,感觉resource里面的脚本应该和外部包放在一起编译,不应该当成普通资源包毕竟这个包是引擎自己加载的。

为什么要把脚本放resources里。

预制件在里面, 我是把预制件和它绑定的脚本放在一起的, 懒得找来找去