---
title: "Understanding RequireJS for Effective JavaScript Module Loading"
author: "cute.spring"
date: "2014-05-15T12:58:07Z"
tags: []
categories: ["Web前端"]
slug: "understanding-requirejs-for-effective-javascript-module-loading"
draft: false
lastmod: "2014-05-15T12:58:07Z"
id: 2066790
url: "https://cute-spring.iteye.com/blog/2066790"
---

原文见： [Understanding RequireJS for Effective JavaScript Module Loading](http://www.sitepoint.com/understanding-requirejs-for-effective-javascript-module-loading/)

一篇不错的介绍在rich client application项目中引入RequireJS的必要性。
RequireJS的主要用途:
1. 通过简单的一个define()函数，引入模块化编程
2. 通过下列方式，处理模块间的依赖
   define(, function(A, B, C){
      return xx;// xx can be any JS object like "string", 123, function(){}...
   })


define() 与 require()的区别详见原文