Creator会把JS为后缀的文件,定义为ESM,所以如果是引用带JS为后缀的包名,都会报错。 例如这个包,它包名叫big.js https://github.com/MikeMcl/big.js 假如我们准备写一份big.d.ts(事实上作者有做d.ts可以不用自己写,但原理是一样的,Creator也不认) declare module 'big' 然后正常来说,直接使用的时候,我们加...
按照3.5的教程制作插件,默认的情况下每次打开项目都会报错 fs-extra是文件系统扩展,用于插件的弹窗界面index.ts中。 查看报错信息后,发现是cocos的模板在报错。进入C盘用户 .CocosCreator/extensions/cocos-build-template目录。 在这个文件目录下空白处按Shift+右键,选择在此处打开Powershell窗口 输入npm install fs-extra...
https://forum.cocos.org/t/cocoscreator1-10-require-cannot-find-module/63830 我是大厅+子游戏的模式,通过热更新下载子游戏。进入子游戏是通过require('子游戏可写目录全路径/main.js'')的方式。在1.9.3版本时是可以的,今天升级到1.10后出现如下错误 ERROR: Uncaught Error: Cannot find module '/data/user...
[已发布][插件] Cocos Creator 构建后 · 代码混淆 3.x+2.x 版 (优惠中) https://store.cocos.com/app/detail/3740 已支持 2.x 和 3.x 的微信小游戏和抖音小游戏的…
I'm using: Cocos Creator v2.1.0 i18n package (https://github.com/cocos-creator-packages/i18n) installed locally from Extension Store I import it like all the examples: const i18n = require("LanguageData"); It works well in local developm...
由于脚本模块化加载的需要,我们从 Cocos Creator ***个版本开始就对用户的脚本进行编译打包,但对于规模庞大、动辄几百个脚本的项目来说,每次修改任何脚本都会触发整个编译打包流程,会使得修改脚本后的等待时间非常长。为了解决这个问题,我们从 v1.6 开始引入了编辑器环境下脚本免打包的模块化系统,可以在预览环境下分别...
Cocos Creator v1.6 版本发布了!感谢社区对这个版本漫长测试周期的耐心等待和对测试版的积极试用和反馈。我们在这个版本更新中继续保持了优化性能和提升体验的传统,并且这个版本还是后续一系列重要的引擎进化的开始。 我们希望改善开发者编辑器使用体验的同时,不断提升 JS 和 C++ 引擎的性能,解决开发者最关心的包体、缓...
具体错误: /CocosCreator/Creator/2.4.7/CocosCreator.app/Contents/Resources/app.asar/node_modules/process/browser.js] failed : Error: Cannot find module 我用2.4.7 和 2.4.9都有这个问题
这里因为require的原因,我们就没办法在hooks.ts里引入path,fs了。这里参考creator3.0, 引入js文件 require 不存在,怎么解决和creator 3.0 如何使用js啊,仍然未得到解决。 所以只能在dist文件夹中直接改hooks.js文件。 varpath=require('path');varfs=require('fs');functiononAfterBuild(options,result){if(options...
on the MAC platform after the installation of Creator, open the project, the window can not be displayedDrag the CocosCreator.app from the DMG into the application, and then open it.How do I configure the directory structure generated after build and automatically modify the contents of the ...