RequireJs调研

背景

Problem(问题)

  • Web sites are turning into Web apps(网站正转变为网络应用程序)
  • Code complexity grows as the site gets bigger(代码复杂度随着站点变大而变复杂)
  • Assembly gets harder(组装变得更难【ps】这里我个人认为“组装”是拼接单个js文件中的昂多的代码段 )
  • Developer wants discrete JS files/modules(开发者想分离js文件/模块)
  • Deployment wants optimized code in just one or a few HTTP calls(网站部署者想通过使用一个或者很少http请求来优化代码)

Solution(解决方案)

  • Front-end developers need a solution with:(前端工程师需要一个解决方案,拥有这些功能:)
  • Some sort of #include/import/require(一些引入文件的命令语句)
  • ability to load nested dependencies(加载嵌套的依赖文件)
  • ease of use for developer but then backed by an optimization tool that helps deployment(简单好用,但也有助于优化部署)

Read More