我看了一下你那个@ton/phaser-sdk,它里面引用Phaser的方式是直接用Phaser这个命名空间,并没有用import。所以,phaser.js(可以在node_modules/phaser/dist目录下找到)需要你自己放入assets目录,并在属性面板中勾选为js插件。
出现Buffer is not defined这个报错,则是因为它引用了Buffer,Buffer是nodejs的模块,在浏览器环境中不可使用。解决方案(来自网络)是在index.html加入以下语句:
<script src="url"></script>
<script>
window.Buffer = window.buffer.Buffer;
</script>
将url替换为 https://bundle.run/buffer@6.0.3当然,js文件也可以自行下载放到bin目录中引入。