Results 7 comments of wht

试了一下,即使是在ts文件里面引入了一个自定义的hello级别的js文件都有有同样的问题,测试用js文件内容如下: //example.js var x = 5 var addX = function (value) { var res = value + x return res } module.exports.x = x module.exports.addX = addX puer build --target...

import 方式似乎只对简单的js模块有效,对于复杂的js库,比如rxjs,build时还是会报上面的错误

我的环境 win10,node 16.15.0,PuerTS_Nodejs_1.4.1 修改update方法内容还是不生效,只能实时编译

if(developerTools != string.Empty){ Debug.Log("ExecuteModule developerTools "); // 启用 SourceMap 映射 vm.ExecuteModule(developerTools); }; log有正常打印

3 拿到模块ID undefined 走到这里

在init方法里面 console.log('写入文件信息',scriptId,filePath,params.url);打印信息如下: 写入文件信息 155 27b704a87689e8f5acbc06f514deb89d G:/svn/TestPuerTs/Assets/Resources/JS/App.js 但是在update方法里面: console.log("3 拿到模块ID",scriptId,createHash(filePath),filePath);打印信息如下: 3 拿到模块ID undefined 1d88aed68f03ecda690fe152a5492f93 G:\svn\TestPuerTs\Assets\Resources\JS\App.js. 两个地方产生的hash不一样,应该是 分隔符 / \ 造成的 在update方法第一行加上 filePath = filePath.replace(/\\/g,'/'); 现在可以hotreload了