CommonJS 是个规范,主要用于js后端,
var foo = require("./foo");
foo("Hi");
AMD前置加载 require.js
require([‘math‘], function (math) {
math.add(2, 3);
});
参考文件 https://www.cnblogs.com/chenguangliang/p/5856701.html
CommonJS 是个规范,主要用于js后端,
var foo = require("./foo");
foo("Hi");
AMD前置加载 require.js
require([‘math‘], function (math) {
math.add(2, 3);
});
参考文件 https://www.cnblogs.com/chenguangliang/p/5856701.html
原文:https://www.cnblogs.com/brucetie/p/8336730.html