install r.js npm install -g requirejs refer: https://github.com/jrburke/r.js 在当前目录下执行: r.js -o build.js 待验证 main.js中的全局变量在合并后是否正常?