摘要:
RequireJS是一个模块加载框架,所以为了最直观的感受它,我们先来看看它的加载系统。先看入口方法:/** * Does the request to load a module for the browser case. * Make this a separate function to allow other environments * to override it. * * @param {Object} context the require context to find state. * @param {String} moduleName the name of the m 阅读全文
摘要:
例子来自官方,我稍微改造了一下,如下:// project.html<!DOCTYPE html><html> <head> <title>requirejs</title> <!-- data-main attribute tells require.js to load scripts/main.js after require.js loads. --> <script data-main="scripts/main" src="scripts/require.js"&g 阅读全文