【发布时间】:2011-12-28 03:03:52
【问题描述】:
在开发过程中,我使用 JS 模块来更好地组织我的代码。例如,我有module1.js、module2.js,这两个模块都包含在main.js 和LABjs中
$LAB
.script("module1.js").wait()
.script("module2.js").wait();
不过,我也使用 Google Closure Compiler 进行代码优化,它需要根据 documentation 集成的 javascript 文件。
解决此问题的最简单方法是将函数与调用这些函数的程序部分一起编译。
所以我想将所有模块集成到一个 js 文件中,然后可以使用 Google Closure Compiler 进行编译。 LabJS 在客户端运行,不会在服务器端完成任务。那么有什么工具可以完成这项工作吗?或者是否有其他库支持服务器端模块集成?
【问题讨论】:
标签: javascript module integration loading code-organization