gpt4 book ai didi

javascript - CommonJS 和 RequireJS 哪个更适合 JavaScript 游戏开发?

转载 作者:行者123 更新时间:2023-11-30 18:39:11 25 4
gpt4 key购买 nike

我正计划构建一个基于 JavaScript、html5、nodejs 的游戏。我知道 Nodejs 使用 CommonJS,但是我知道 RequireJS 是 CommonJS 的竞争对手,据说更适合客户端。 RequireJS 是我的客户端 JavaScript 的更好替代品吗?

我还没有任何一种 API 的经验。

http://requirejs.org/

http://www.commonjs.org/

最佳答案

你的问题没有意义。 CommonJS 只不过是 Javascript 开发中常见任务的一组标准。 RequireJS 是 Web 浏览器的 CommonJS 模块系统的实现。 Node 是一个服务器端 Javascript 平台,它实现了各种 CommonJS 标准。

简而言之,Node 用于服务器端 Javascript 编程,而 RequireJS 用于模块化客户端 Javascript 代码。您可以在 Node 中使用 RequireJS 作为替代模块系统,但这不是它的主要用例。

关于javascript - CommonJS 和 RequireJS 哪个更适合 JavaScript 游戏开发?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7359008/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com