TypeScriptToLua npm 集成玩法

TypeScriptToLua npm 集成要求

格式&限制

  • 不能包含.ts 以及.tsx 源文件
  • 必须使用buildMode为library
  • 推荐添加declaration true
  • 不能使用luaBundle 做为包依赖
  • package.json 格式定义main 以及types ,需要使用相对路径,同时不能包含文件扩展

参考图

 

 

说明

基于npm 的lua 模块管理是一个不错的模式,但是在集成的时候会有包查找的问题,可以基于lua_path 以及lua_cpath 解决,但是目前来说并不是
特别好,看了github issue 官方也在计划调整中

参考资料

https://github.com/TypeScriptToLua/TypeScriptToLua
https://typescripttolua.github.io/docs/configuration
https://typescripttolua.github.io/docs/publishing-modules
https://www.lua.org/manual/5.1/manual.html
https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1118
https://github.com/TypeScriptToLua/TypeScriptToLua/pull/1241

posted on 2022-04-17 11:59  荣锋亮  阅读(86)  评论(0编辑  收藏  举报

导航