开发者

Best way to create custom build system for JavaScript, for automated builds?

How to create a build system for number of JS client applications, all using same framework but different combinations of framework parts? This would enable all client applications receive the framework updates automatically, without having to rely on one distribution file, containing all framework abilities (which would be rather sub-optimal).

In best case scenario, the client applications would use the only specific pa开发者_运维技巧rts (raw, non-minimized files) from the framework project, while when deployed, the application would have only one script containing only the needed functionalities of the framework. Also, if(/when) all this can't be done automatically, there should be only one "makefile" that would be used for both, loading single files in development and building the single JS file for deployment.


GWT does what you are requesting through a feature called deferred binding. http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsDeferred.html

THE GWT compiler generates many versions of code at compile time, versions are created automatically per browser type, and it's possible to extend this functionality to other parameters such as user localization preferences or completely arbitrary parameters.


I finally managed to do this with combination of custom buildfiles, custom runtime build system done in PHP, sophisticated JavaScript non-coupling framework and massive Ant build scripts, doing the compiling and deployment. :P

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜